Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window设置maximumHeight和minimumHeight为同一个数值时,实际窗口高度会大31 #76

Open
ZhongHuaRong opened this issue May 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ZhongHuaRong
Copy link

image
使用的qt 5.15.13测试,显示窗口时会比默认设置的高31,拖动窗口后会恢复到设置的数值

@SineStriker
Copy link
Contributor

确实,widget也有这个问题。这个问题我看了一下比较复杂,暂时不太好解决,现在还是请尽量在setup以后再调整尺寸。

@SineStriker SineStriker added the bug Something isn't working label May 11, 2024
@ZhongHuaRong
Copy link
Author

试了一下,需要在窗口显示之后再显式设置高度(随便一个数值),然后通过centralize居中

Window {
    id: window
    maximumHeight: 600
    minimumHeight: 600
    maximumWidth: 800
    minimumWidth: 800
    Component.onCompleted: {
        windowAgent.setup(window)
        window.visible = true
        window.height = maximumHeight
        windowAgent.centralize()
    }
}

这个bug Ubuntu下未复现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants