summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2015-03-31 11:36:30 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2015-04-02 23:24:05 +0000
commit70d4b35b937d8a98be156b159bafbc07bfb03097 (patch)
treeaa499dc2503a720324549aaf52db8018d986b10a
parentc4ed23b3e05eeb4554571b725b24eedc99845b5f (diff)
QStyleSheetStyle: do not style the moving tab of a QTabBar
QTabBar uses a palette brush on a child QWidget. But if that widget get styled, it sets the palette on it overwriting the existing palette. Make sure that no stylesheet is applied to it. [ChangeLog][QtWidgets][QTabBar] Fixed moving tab when a stylesheet is applied. Task-number: QTBUG-45173 Task-number: QTBUG-15128 Change-Id: I07aee0f369fa715d852556620c8e74bcffd836da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 4993457b32..86b5632d2e 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2393,6 +2393,13 @@ static bool unstylable(const QWidget *w)
return true;
}
#endif
+
+#ifndef QT_NO_TABBAR
+ if (w->metaObject() == &QWidget::staticMetaObject
+ && qobject_cast<const QTabBar*>(w->parentWidget()))
+ return true; // The moving tab of a QTabBar
+#endif
+
return false;
}