View Full Version : QTabWidget tab subcontrol position with qss
alexandernst
15th May 2010, 01:16
I want to put tab-bar at the bottom of the qtabwidget, and I'm trying to do it with this code:
QTabWidget::tab-bar {
position: absolute;
subcontrol-origin: margin;
subcontrol-position: center bottom;
}
but it won't work.
Where is the error?
P.S: I know that this is possible to be done with .setTabPosition, but I want to do it with qss
alexandernst
15th May 2010, 17:56
According to: http://doc.qt.nokia.com/4.6/stylesheet-reference.html
Warning:
To change the position of the QTabBar within a QTabWidget, use the tab-bar subcontrol (and set subcontrol-position).
See Customizing QTabBar for an example.
subcontrol-position*
The alignment of the subcontrol within the origin rectangle specified by subcontrol-origin.
If this property is not specified, it defaults to a value that depends on the subcontrol.
Example:
QSpinBox::down-button {
image: url(:/images/spindown.png);
subcontrol-origin: padding;
subcontrol-position: right bottom;
}
Maybe this is a bug?
subcontrol-origin*
The origin rectangle of the subcontrol within the parent element.
If this property is not specified, the default is padding.
Example:
QSpinBox::up-button {
image: url(:/images/spinup.png);
subcontrol-origin: content;
subcontrol-position: right top;
}
alexandernst
15th May 2010, 18:24
Ok, I found it.
QTabWidget {
qproperty-tabPosition: South;
}
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.