diff options
author | Sergio Martins <sergio.martins@kdab.com> | 2018-03-28 18:24:22 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-20 18:20:10 +0000 |
commit | 1580c84e1a3c6658f317f7bc78c64575160c1d65 (patch) | |
tree | ad67e207c2d39ea8702501845c95b553b6779050 | |
parent | 7d0cbfc257ac18d14140f5516a0269a4d8ac320a (diff) |
Make QStyle::proxy() always return the leaf proxy
For example:
fusion -> proxy1 -> proxy2
Now returns proxy2.
Fixes: QTBUG-85556
Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 61c3f3539c3d2d7dc867c3fef0270a2f5c9ed376)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 239d873649..8d8764b76b 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -2401,17 +2401,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; } |