Qt QDialog 和 GNOME 3,如何显示关闭按钮/标题栏并使其可移动?
在 GNOME 3 中,当显示任何 QDialog 时,它似乎无法移动并且没有标题栏。
有没有办法重新启用标题栏并使其可移动?我尝试使用 QMainWindow 作为解决方法,但它出现在任务栏中,并且不会显示为“模式”对话框。
In GNOME 3 when displaying any QDialog it appears that it can't be moved and it has no title bar.
Is there a way to re-enable the title bar and make it movable? I attempted to use a QMainWindow as a workaround instead but it appears in the task bar and won't appear as a "modal" dialog.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许,它可能对您有帮助:
在 Alt+F2 提示中键入 r重新启动 Gnome shell 并查看更改(QDialogs 应该变得可移动)。
Probably, it might help you:
Type r in Alt+F2 prompt to restart Gnome shell and see the changes (QDialogs should become movable).
当我在对话框中遇到此问题(至少是无标题栏部分)时,我通过将对话框的父级设置为 nullptr 而不是设置真正的父级来解决该问题。
http://blog.pitonyak.org/node/18
现在,设置配置gnome 中的选项如果有效的话可能是一个更好的解决方案(并且我没有验证它)。我对该解决方案的唯一抱怨是它在另一台计算机上的表现会有所不同。话又说回来,有人可能会争辩说,拥有配置选项的意义在于该机器的所有者可以决定。
When I had this problem with a dialog (at least the no title bar part), I fixed the issue by setting the dialog's parent to be nullptr as opposed to setting a real parent.
http://blog.pitonyak.org/node/18
Now, that said, setting the configuration option in gnome is probably a better solution if it works (and I did not verify it). My only complaint with the solution is that then it will behave differently on another computer. Then again, one could argue that the point of having the configuration option is that the owner of that machine can decide.