summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-28 11:28:34 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-28 12:33:55 (GMT)
commitddb2cd234e49c841338dab60a02e4945b1957ac0 (patch)
tree2f92488307855f6732180e7ec37af409638c514e /src/gui
parent0a0d5e3e916c0ebd69c717843c9cd1b41102b427 (diff)
downloadQt-ddb2cd234e49c841338dab60a02e4945b1957ac0.zip
Qt-ddb2cd234e49c841338dab60a02e4945b1957ac0.tar.gz
Qt-ddb2cd234e49c841338dab60a02e4945b1957ac0.tar.bz2
QTabBar: Add ability to change the position of the close button in the stylesheet
Task-number: 241383 Reviewed-by: jbache
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 7538eb4..da71ced 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -5112,6 +5112,18 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
#endif // QT_NO_TABWIDGET
s = QLatin1String("alignment");
break;
+#ifndef QT_NO_TABBAR
+ case SH_TabBar_CloseButtonPosition:
+ rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton);
+ if (rule.hasPosition()) {
+ Qt::Alignment align = rule.position()->position;
+ if (align & Qt::AlignLeft || align & Qt::AlignTop)
+ return QTabBar::LeftSide;
+ if (align & Qt::AlignRight || align & Qt::AlignBottom)
+ return QTabBar::RightSide;
+ }
+ break;
+#endif
case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break;
case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break;
case SH_ComboBox_PopupFrameStyle: