From 6094197294481f586fe544e326ed1056a800e3f1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 13 Apr 2012 07:30:02 -0700 Subject: [PATCH] api: Make QGuiApplication::styleHints() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Practically all functions in QGuiApplication are static. Change-Id: I5948620865c021029a3c04b31901b1110e6c0d27 Reviewed-by: Samuel Rødal --- src/gui/kernel/qguiapplication.cpp | 9 ++++----- src/gui/kernel/qguiapplication.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 6a93ef4d09..cb6f26b2c5 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1976,12 +1976,11 @@ void QGuiApplication::restoreOverrideCursor() \sa QStyleHints */ -QStyleHints *QGuiApplication::styleHints() const +QStyleHints *QGuiApplication::styleHints() { - Q_D(const QGuiApplication); - if (!d->styleHints) - const_cast(d)->styleHints = new QStyleHints(); - return d->styleHints; + if (!qGuiApp->d_func()->styleHints) + qGuiApp->d_func()->styleHints = new QStyleHints(); + return qGuiApp->d_func()->styleHints; } /*! diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index b58720db13..858083b10b 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -124,7 +124,7 @@ public: static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; } static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; } - QStyleHints *styleHints() const; + static QStyleHints *styleHints(); static void setDesktopSettingsAware(bool on); static bool desktopSettingsAware();