summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.cpp
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2018-03-28 18:24:22 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-01-20 15:35:46 +0000
commit61c3f3539c3d2d7dc867c3fef0270a2f5c9ed376 (patch)
treea594ebad390315b04404e7771db914b91618c9b3 /src/widgets/styles/qstyle.cpp
parentfb51b4732c589db37b1c07f5979d62c2717a7d33 (diff)
Make QStyle::proxy() always return the leaf proxy
For example: fusion -> proxy1 -> proxy2 Now returns proxy2. Fixes: QTBUG-85556 Pick-to: 6.0 5.15 Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r--src/widgets/styles/qstyle.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index c839afd639..8aa423c224 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -2430,17 +2430,19 @@ int QStyle::combinedLayoutSpacing(QSizePolicy::ControlTypes controls1,
const QStyle * QStyle::proxy() const
{
Q_D(const QStyle);
- return d->proxyStyle;
+ return d->proxyStyle == this ? this : d->proxyStyle->proxy();
}
/* \internal
This function sets the base style that style calls will be
- redirected to. Note that ownership is not transferred.
+ redirected to. Note that ownership is not transferred. \a style
+ must be a valid pointer (not nullptr).
*/
void QStyle::setProxy(QStyle *style)
{
Q_D(QStyle);
+ Q_ASSERT(style);
d->proxyStyle = style;
}