[英]How to add the “full screen” button to the title bar on the far right hand side?
Most Mac applications, including third party ones such as Chrome Browser come with the "Full Screen" icon, placed on the far right side of the title bar. 大多数Mac应用程序(包括第三方应用程序,例如Chrome浏览器)都带有“全屏”图标,位于标题栏的最右侧。
I would like to do the same thing. 我想做同样的事情。
I've done some research but I can not find how to show/hide this button or how to modify the titlebar itself. 我已经做过一些研究,但是找不到如何显示/隐藏此按钮或如何修改标题栏本身。
Is it not possible? 不可能吗 Would I need a complete custom titlebar for this?
我需要一个完整的自定义标题栏吗? I don't want to do that to not to lose default window manager's perks.
我不想那样做,以免丢失默认窗口管理器的特权。
Thank you 谢谢
Check out what the Qt Project has to say about 看看Qt项目要说些什么
How to handle events in the titlebar and change its color etc? 如何处理标题栏中的事件并更改其颜色等?
The titlebar belongs to the OS and we don't have control over that one.
标题栏属于操作系统,我们无法控制该标题栏。 You can create your own titlebar, but note that this requires some work.
您可以创建自己的标题栏,但是请注意,这需要一些工作。 In order to create your own titlebar then make a QWidget [doc.qt.nokia.com] subclass that contains three toolbuttons that handle the close, minimize and maximize events in addition to the moving of the window.
为了创建自己的标题栏,请创建一个QWidget [doc.qt.nokia.com]子类,该子类包含三个工具按钮,这些按钮不仅可以移动窗口,而且可以处理关闭,最小化和最大化事件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.