summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-09-05 12:52:43 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-09-21 01:09:51 +0200
commit9b6179cf957c32e0c02547d510dfee2088f02340 (patch)
treed78e2561ef76782753a09d69f098c1e764836987 /src/widgets
parentb8a911fbebfcd297ce08b91fbe85bb1624d257d9 (diff)
Ensure all children of a widget get updated when a stylesheet changes
Before, only the direct children would get an update when the stylesheet changed, any children below that would be unchanged. Fixes: QTBUG-77006 Change-Id: Id668eaae74a8289d78d66644f077e6a3302960cd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 85b65f39b1..98a9f74f5b 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2735,6 +2735,11 @@ static void updateObjects(const QList<const QObject *>& objects)
if (auto widget = qobject_cast<QWidget*>(const_cast<QObject*>(object))) {
widget->style()->polish(widget);
QApplication::sendEvent(widget, &event);
+ QList<const QObject *> children;
+ children.reserve(widget->children().size() + 1);
+ for (auto child: qAsConst(widget->children()))
+ children.append(child);
+ updateObjects(children);
}
}
}