diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-02-14 08:55:02 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-15 02:34:58 +0100 |
commit | 3d3f5f84fe3bbe9862ac3837c9dfb38216c1a081 (patch) | |
tree | 6f9c65454c2e05200c85a5545960fb0e3b2dac5b | |
parent | 78a6447e311e55320ab3acd5f1035f3c295bf5f8 (diff) |
Move desktopSettingsAware to QGuiApplication.
For use by the QPA plugins.
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Morten Sørvig <morten.sorvig@nokia.com>
Task-number: QTBUG-24204
Change-Id: I7f35274eedb55fcb60ad289768234bc302286d01
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 27 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 1 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 28 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.h | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 1 |
6 files changed, 31 insertions, 32 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 0e525da151..5ca6364fbb 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -126,6 +126,7 @@ QWindow *QGuiApplicationPrivate::focus_window = 0; static QBasicMutex applicationFontMutex; QFont *QGuiApplicationPrivate::app_font = 0; +bool QGuiApplicationPrivate::obey_desktop_settings = true; extern void qRegisterGuiVariant(); extern void qUnregisterGuiVariant(); @@ -1619,6 +1620,32 @@ QStyleHints *QGuiApplication::styleHints() const return d->styleHints; } +/*! + Sets whether Qt should use the system's standard colors, fonts, etc., to + \a on. By default, this is true. + + This function must be called before creating the QGuiApplication object, like + this: + + \snippet doc/src/snippets/code/src_gui_kernel_qapplication.cpp 6 + + \sa desktopSettingsAware() +*/ +void QGuiApplication::setDesktopSettingsAware(bool on) +{ + QGuiApplicationPrivate::obey_desktop_settings = on; +} + +/*! + Returns true if Qt is set to use the system's standard colors, fonts, etc.; + otherwise returns false. The default is true. + + \sa setDesktopSettingsAware() +*/ +bool QGuiApplication::desktopSettingsAware() +{ + return QGuiApplicationPrivate::obey_desktop_settings; +} /*! \since 5.0 diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index 75046d8767..d853bc1410 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -121,6 +121,9 @@ public: static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; } QStyleHints *styleHints() const; + static void setDesktopSettingsAware(bool on); + static bool desktopSettingsAware(); + QT_DEPRECATED QInputPanel *inputPanel() const; QInputMethod *inputMethod() const; diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 66db8437e5..5f2e92c504 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -181,6 +181,7 @@ public: static QFont *app_font; QStyleHints *styleHints; + static bool obey_desktop_settings; QInputMethod *inputMethod; static QList<QObject *> generic_plugin_list; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 8d776e2f29..4387d2a287 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -419,7 +419,6 @@ QWidget *QApplicationPrivate::main_widget = 0; // main application widget QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input focus QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show() QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus -bool QApplicationPrivate::obey_desktop_settings = true; // use winsys resources #ifndef QT_NO_WHEELEVENT int QApplicationPrivate::wheel_scroll_lines; // number of lines to scroll #endif @@ -2911,33 +2910,6 @@ QDesktopWidget *QApplication::desktop() } /*! - Sets whether Qt should use the system's standard colors, fonts, etc., to - \a on. By default, this is true. - - This function must be called before creating the QApplication object, like - this: - - \snippet doc/src/snippets/code/src_gui_kernel_qapplication.cpp 6 - - \sa desktopSettingsAware() -*/ -void QApplication::setDesktopSettingsAware(bool on) -{ - QApplicationPrivate::obey_desktop_settings = on; -} - -/*! - Returns true if Qt is set to use the system's standard colors, fonts, etc.; - otherwise returns false. The default is true. - - \sa setDesktopSettingsAware() -*/ -bool QApplication::desktopSettingsAware() -{ - return QApplicationPrivate::obey_desktop_settings; -} - -/*! Returns the current state of the modifier keys on the keyboard. The current state is updated sychronously as the event queue is emptied of events that will spontaneously change the keyboard state (QEvent::KeyPress and diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index bace73e072..503b36aec6 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -158,9 +158,6 @@ public: static Qt::KeyboardModifiers queryKeyboardModifiers(); static Qt::MouseButtons mouseButtons(); - static void setDesktopSettingsAware(bool); - static bool desktopSettingsAware(); - static void setCursorFlashTime(int); static int cursorFlashTime(); diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index b4cd22df13..790176afe3 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -267,7 +267,6 @@ public: static QWidget *hidden_focus_widget; static QWidget *active_window; static QIcon *app_icon; - static bool obey_desktop_settings; #ifndef QT_NO_WHEELEVENT static int wheel_scroll_lines; #endif |