diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-04-05 13:02:35 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-04-19 11:04:06 +0000 |
commit | be78baa165e238c1a3febe21ebaf7cacc133d48b (patch) | |
tree | 526e9118c0eba951b60e4ac95540ad4e5c0e11c7 /tests | |
parent | edc7aec065356b9f58ce82a038cca092cad76e2d (diff) |
Fix crash if QPixmap::defaultDepth() is called when no QGuiApplication
This static method can be called before QGuiApplication is created. At
that point there is yet no primary screen, so the implementation
needs to guard against dereferencing a nullptr.
Task-number: QTBUG-67309
Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 7f782e1fc41ff7694f9bf7434d5a4db0545c0413)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index a935258fb8..4548bb6a54 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -1070,6 +1070,8 @@ void tst_QGuiApplication::staticFunctions() QGuiApplication::setQuitOnLastWindowClosed(true); QGuiApplication::quitOnLastWindowClosed(); QGuiApplication::applicationState(); + + QPixmap::defaultDepth(); } void tst_QGuiApplication::settableStyleHints_data() |