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>
bb10
Olivier Goffart 2015-03-31 11:36:30 +02:00 committed by Olivier Goffart (Woboq GmbH)
parent c4ed23b3e0
commit 70d4b35b93
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}