包裹菜单栏的 Qt Tab 小部件
当 QTabWidget 的菜单超出其宽度时,默认行为是将选项卡菜单变成水平可滚动列表。我更喜欢将菜单环绕起来,这样你现在就有了两行选项卡。此样式用于某些 Windows 对话框。但我找不到任何方法来做到这一点。
有谁知道允许这种布局的技巧或选项?
When the menu of a QTabWidget grows beyond its width, the default behaviour is to turn the tab menu into a horizontaly scrollable list. What I'd prefer is to wrap the menu round so you now have two rows of tabs. This style is used on some Windows dialogs. I can't find any way to do this though.
Is anyone aware of a trick or option to allow this kind of layout?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
流布局可以满足您的需要,但是您还必须制作自己的“选项卡小部件” http://doc.trolltech.com/4.7/layouts-flowlayout.html
Flow layout does what you need, but then you will have to also make your own "tab widget" http://doc.trolltech.com/4.7/layouts-flowlayout.html
此选项当前不适用于
QTabWidget
。也许您可以使用一些QTabBars
来模拟这种行为?Qt 的错误跟踪器,但尚未取得任何进展。也许有人知道另一个组件/解决方案。
This option is currently not available for
QTabWidget
. Perhaps you could simulate this behavior using a fewQTabBars
?There is an outstanding request for this on Qt's bug tracker but no progress on it yet. Perhaps somebody knows of another component/solution.