summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-10-03 10:16:22 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-03 11:55:32 +0200
commit598d37a2f03db618e18a0f9ea320cea8405d83c0 (patch)
treef4042e80fb31b20c2ac85ef95a57c3590eafdfb1 /src/gui/image/qpixmap.cpp
parent677cf76340f88e0fe51c1f75aa512b6d835414ca (diff)
qpixmap: Use the primaryScreen for QPixmap::defaultDepth
Currently tst_QPixmap::testMetrics can fail if the native display resolution is below 32 bpp. Upate the documentation, use the primary screen to find the depth. Tested-on: XCB and directFB plugin. Change-Id: I29c08db25d8f6bcee01f9315ed90685fef668e0c Merge-request: 61 Reviewed-on: http://codereview.qt-project.org/5917 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r--src/gui/image/qpixmap.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index c2b9c6a1b9..00451268f3 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -59,6 +59,7 @@
#include "qimagereader.h"
#include "qimagewriter.h"
#include "qpaintengine.h"
+#include "qscreen.h"
#include "qthread.h"
#include "qdebug.h"
@@ -1648,16 +1649,14 @@ QBitmap QPixmap::mask() const
/*!
Returns the default pixmap depth used by the application.
- On Windows and Mac, the default depth is always 32. On X11 and
- embedded, the depth of the screen will be returned by this
- function.
+ On all platforms the depth of the primary screen will be returned.
\sa depth(), QColormap::depth(), {QPixmap#Pixmap Information}{Pixmap Information}
*/
int QPixmap::defaultDepth()
{
- return 32; // LITE: ### use QPlatformScreen (we should do that in general)
+ return QGuiApplication::primaryScreen()->depth();
}
/*!