diff options
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints_p.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 69de74e2c3..9bd686070d 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -129,7 +129,8 @@ int QStyleHints::touchDoubleTapDistance() const */ Qt::Appearance QStyleHints::appearance() const { - return d_func()->appearance(); + Q_D(const QStyleHints); + return d->appearance(); } /*! @@ -597,10 +598,11 @@ int QStyleHints::mouseQuickSelectionThreshold() const */ void QStyleHintsPrivate::setAppearance(Qt::Appearance appearance) { - if (m_appearance != appearance) { - m_appearance = appearance; - emit q_func()->appearanceChanged(appearance); - } + if (m_appearance == appearance) + return; + m_appearance = appearance; + Q_Q(QStyleHints); + emit q->appearanceChanged(appearance); } QStyleHintsPrivate *QStyleHintsPrivate::get(QStyleHints *q) diff --git a/src/gui/kernel/qstylehints_p.h b/src/gui/kernel/qstylehints_p.h index 4a16fbef01..a93a410987 100644 --- a/src/gui/kernel/qstylehints_p.h +++ b/src/gui/kernel/qstylehints_p.h @@ -40,8 +40,9 @@ public: int m_mouseDoubleClickDistance = -1; int m_touchDoubleTapDistance = -1; - Qt::Appearance appearance() const { return m_appearance; }; + Qt::Appearance appearance() const { return m_appearance; } void setAppearance(Qt::Appearance appearance); + static QStyleHintsPrivate *get(QStyleHints *q); private: |