diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-15 01:00:18 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-15 01:00:18 +0200 |
commit | 4aa6f54fec9d199f97759945118451c52767b2ce (patch) | |
tree | 5dc695cd4718437b5015aaef3a02463c61bc5dc2 /src/gui/image | |
parent | 369e7572bac94bb5b83ef881012fdc4a86829496 (diff) | |
parent | d5ac11891d8237ca2f02390ffd0ff103578b520e (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 4cd8befc1b..4b2334ae52 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1467,12 +1467,18 @@ QBitmap QPixmap::mask() const On all platforms the depth of the primary screen will be returned. + \note QGuiApplication must be created before calling this function. + \sa depth(), QColormap::depth(), {QPixmap#Pixmap Information}{Pixmap Information} */ int QPixmap::defaultDepth() { - return QGuiApplication::primaryScreen()->depth(); + QScreen *primary = QGuiApplication::primaryScreen(); + if (Q_LIKELY(primary)) + return primary->depth(); + qWarning("QPixmap: QGuiApplication must be created before calling defaultDepth()."); + return 0; } /*! |