diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-23 17:01:24 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-25 14:16:44 +0000 |
commit | 33403f2c79d678afc5b76add2c517d99b9708c32 (patch) | |
tree | 796fb3e1607a14b9e9e7f00a2e35a326ec083ba6 /src/widgets/kernel | |
parent | 7bbde34ee012bbe90c4ce76736c6f71b16e64215 (diff) |
Fix crash when accessing QStyleHints before QGuiApplication is constructed.
Make styleHints a static member variable of QGuiApplicationPrivate and
fix accessor accordingly. Extend tst_QApplication::settableStyleHints()
to run without QApplication instance as well and add a similar test
to QGuiApplication.
Task-number: QTBUG-44499
Change-Id: I42b92ef38f7dd512d08d70accfa7dd4f09a22f01
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ad51dc5055..e761520228 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2892,7 +2892,7 @@ void QApplication::setStartDragTime(int ms) int QApplication::startDragTime() { - return qApp->styleHints()->startDragTime(); + return QGuiApplication::styleHints()->startDragTime(); } /* @@ -2930,7 +2930,7 @@ void QApplication::setStartDragDistance(int l) int QApplication::startDragDistance() { - return qApp->styleHints()->startDragDistance(); + return QGuiApplication::styleHints()->startDragDistance(); } /*! @@ -3973,7 +3973,7 @@ void QApplication::setCursorFlashTime(int msecs) int QApplication::cursorFlashTime() { - return qApp->styleHints()->cursorFlashTime(); + return QGuiApplication::styleHints()->cursorFlashTime(); } /*! @@ -3991,7 +3991,7 @@ void QApplication::setDoubleClickInterval(int ms) int QApplication::doubleClickInterval() { - return qApp->styleHints()->mouseDoubleClickInterval(); + return QGuiApplication::styleHints()->mouseDoubleClickInterval(); } /*! @@ -4019,7 +4019,7 @@ void QApplication::setKeyboardInputInterval(int ms) int QApplication::keyboardInputInterval() { - return qApp->styleHints()->keyboardInputInterval(); + return QGuiApplication::styleHints()->keyboardInputInterval(); } /*! |