问题描述
我打开一个窗体窗口,并希望保持它顶部总是无论是否关注,我使用此函数 setWindowFlags(Qt :: Dialog | Qt :: WindowStaysOnTopHint)
的QT它是工作正常在Mac上,因为我的愿望,但是当我使用相同的函数在centos它不能正常工作和窗口隐藏时不集中
I am opening a form window and wants to stay it on top always whether it is focused or not , i am using this function setWindowFlags(Qt::Dialog | Qt::WindowStaysOnTopHint)
of QT it is working fine on Mac as i desire but when i use the same function on centos it doesn't work correctly and window hides when not focused
推荐答案
我已经解决了这个问题,只是在函数中添加另一个标志
I have solved this problem by just adding another flag in the function
setWindowFlags(Qt :: Dialog | Qt :: WindowStaysOnTopHint | Qt :: X11BypassWindowManagerHint)
setWindowFlags(Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint )
这篇关于setWindowFlag(Qt :: Dialog | Qt :: WindowStaysOnTopHint)不工作在Centos的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!