summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-10-22 22:00:11 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-10-22 22:00:11 (GMT)
commit0787890a9a06a0f05c78c7e4d85655fdc1fc9398 (patch)
tree824906aa3899243d46e2590a86ccd114259712a5 /src/gui
parent215f46d0a61a2f48d1ccbbc52c3b161fa36c84ec (diff)
parentdb14623485396fd69839e519184b794775b65b01 (diff)
downloadQt-0787890a9a06a0f05c78c7e4d85655fdc1fc9398.zip
Qt-0787890a9a06a0f05c78c7e4d85655fdc1fc9398.tar.gz
Qt-0787890a9a06a0f05c78c7e4d85655fdc1fc9398.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_x11_p.h2
-rw-r--r--src/gui/kernel/qwidget_qws.cpp24
2 files changed, 25 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index f171281..7eab64c 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -115,7 +115,7 @@ private:
friend class QEglContext; // Needs gl_surface
friend class QGLContext; // Needs gl_surface
friend class QX11GLPixmapData; // Needs gl_surface
- friend class QMeeGoGraphicsSystem; // Needs gl_surface and flags
+ friend class QMeeGoLivePixmapData; // Needs gl_surface and flags
friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface
void release();
diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp
index 3145136..c6cbbd0 100644
--- a/src/gui/kernel/qwidget_qws.cpp
+++ b/src/gui/kernel/qwidget_qws.cpp
@@ -1017,6 +1017,30 @@ int QWidget::metric(PaintDeviceMetric m) const
return static_cast<QWidget *>(d->parent)->metric(m);
const QScreen *screen = d->getScreen();
return qRound(screen->height() / double(screen->physicalHeight() / 25.4));
+ } else if (m == PdmNumColors) {
+ QScreen *screen = d->getScreen();
+ int ret = screen->colorCount();
+ if (!ret) {
+ const int depth = qwsDisplay()->depth();
+ switch (depth) {
+ case 1:
+ ret = 2;
+ break;
+ case 8:
+ ret = 256;
+ break;
+ case 16:
+ ret = 65536;
+ break;
+ case 24:
+ ret = 16777216;
+ break;
+ case 32:
+ ret = 2147483647;
+ break;
+ }
+ }
+ return ret;
} else {
val = QPaintDevice::metric(m);// XXX
}