简体   繁体   English

如何展开QTabWidget的标签栏?

[英]How to expand the QTabWidget's tab bar?

在此处输入图片说明

I have a QTabWidget Like this, I put the tab-bar to the west side. 我有一个QTabWidget像这样,我将标签栏放在西侧。 And now my question is, how could I expand the tabs so that they use all the space on the tab bar? 现在我的问题是,如何扩展选项卡以便它们使用选项卡栏上的所有空间? In stead of leaving the bottom left area blank? 代替将左下方区域留空?

You can do it by setting property in the style sheet: 您可以通过在样式表中设置属性来实现:

tabWidget->setStyleSheet("QTabBar::tab { min-width: 100px; }");

But it won't resize the strings, so you better make your own widget with all elements that you need. 但是它不会调整字符串的大小,因此最好用所需的所有元素制作自己的小部件。 I mean, to create your own view you can add elements at. 我的意思是,要创建自己的视图,可以在处添加元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM