qtabwidget

Hide label text for Qt tabs without setting text to empty string

随声附和 提交于 2019-11-28 13:51:26
I need a QTabWidget with icons only: How can I hide the label text of a tab in Qt? I cannot set the text to an empty string ( "" ), as I am using docked widgets ( QDockWidget ) and the label text is set automatically (and I need it if the widget is floating). But in tabbed mode I just want to display the icons (of the tabs). Possible approaches: Font size to 0? I need to create my own bar class and override the paint event as here Anything easier / cleaner? --- Edit --- Ok, the "set window title to empty string, and reset it the original text" approach works. I am using the topLevelChanged

Qt: Styling QTabWidget

拜拜、爱过 提交于 2019-11-27 11:21:08
问题 I'm using Qt and I have a QTabWidget setup in the Qt Designer Editor, you can see it in picture 1. As you can see after Tab4 there is an empty space all the way to the right edge, in someway I need to fill that space with a color, like in picture 2 (the best thing would be to be able to set a fading color). Or another solution would be that the tabs float out to cover the whole screen. I use the following stylesheet right now: QTabWidget::tab-bar { } QTabBar::tab { background: gray; color:

How to change text alignment in QTabWidget?

落花浮王杯 提交于 2019-11-27 08:09:17
I cannot find a way to set the text alignment in a QTabWidget. After I've created an instance of this widget, I've set its tabPosition property to West, but I wish it showed text/label horizontally. I've given a look to the Qt's stylesheets , but as you can see, the text-align property can only be set on QPushButton and QProgressBar. I already searched on the web, but I just found a bugreport , a non-answered question , and finally a user that suggests to re-implement the paint() method. Maybe I'd solve, but I'm using Python (PyQt or PySide) and I don't know how to do it. Can you help me? EDIT

Hide label text for Qt tabs without setting text to empty string

二次信任 提交于 2019-11-27 07:58:13
问题 I need a QTabWidget with icons only: How can I hide the label text of a tab in Qt? I cannot set the text to an empty string ( "" ), as I am using docked widgets ( QDockWidget ) and the label text is set automatically (and I need it if the widget is floating). But in tabbed mode I just want to display the icons (of the tabs). Possible approaches: Font size to 0? I need to create my own bar class and override the paint event as here Anything easier / cleaner? --- Edit --- Ok, the "set window

How to change text alignment in QTabWidget?

天涯浪子 提交于 2019-11-26 17:45:47
问题 I cannot find a way to set the text alignment in a QTabWidget. After I've created an instance of this widget, I've set its tabPosition property to West, but I wish it showed text/label horizontally. I've given a look to the Qt's stylesheets, but as you can see, the text-align property can only be set on QPushButton and QProgressBar. I already searched on the web, but I just found a bugreport, a non-answered question, and finally a user that suggests to re-implement the paint() method. Maybe I