Pyqt tabs like in Google Chrome(谷歌浏览器中的 Pyqt 标签页)
问题描述
我想让我的 pyqt 应用程序在菜单栏中有标签,例如 Google Chrome :)
I would like to have my pyqt aplication have tabs in the menu bar like Google Chrome :)
关于如何做的任何建议或简单示例?
Any suggestions or a simple example on how to do it?
我确实找到了这些相关链接:
- http://ivan.fomentgroup.org/blog/2009/03/29/instant-chrome/
I did find these relevant link:
- http://ivan.fomentgroup.org/blog/2009/03/29/instant-chrome/
推荐答案
为此,您必须使用 Qt.FramelessWindowHint,然后创建自己的 Max、Min、Close 按钮作为 Widget 并将它们添加到那里.对于这些类型的软件,我有一个很好的工作工具包:http://traipse.assembla.com/spaces/ghostqt
You have to use the Qt.FramelessWindowHint for that, and then create your own Max, Min, Close buttons as Widgets and add them there. I have a good working toolkit for these types of softwares: http://traipse.assembla.com/spaces/ghostqt
在您的情况下,您应该重新分类 resizeEvent 以便您可以更改标志.如果窗口最大化,您无需担心移动它,但如果它没有最大化,您可以删除 Qt.FramelessWindowHint 标志并恢复标题栏;就像 Chrome 一样.
In your case you should reclass the resizeEvent so you can change the flags. If the window is maximized you will not need to worry about moving it around, but if it is not maximized you can remove the Qt.FramelessWindowHint flag and get your title bar back; just like Chrome does.
这就是你要找的吗?
这篇关于谷歌浏览器中的 Pyqt 标签页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:谷歌浏览器中的 Pyqt 标签页


基础教程推荐
- 对多索引数据帧的列进行排序 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01