summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-09-18 09:26:24 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-09-20 11:34:08 (GMT)
commit6930cc6f7247464f1adae143102b5a3811f25345 (patch)
tree4d9fc4eb4c56b4a88389fded21b8ac6a9794f7e7
parent4d8adcd20af9f346d69c9da9e49c9b3cc8a10710 (diff)
downloadQt-6930cc6f7247464f1adae143102b5a3811f25345.zip
Qt-6930cc6f7247464f1adae143102b5a3811f25345.tar.gz
Qt-6930cc6f7247464f1adae143102b5a3811f25345.tar.bz2
Give a warning in QPixmap::handle() if pixmap is not X11 class.
Reviewed-by: Markus Goetz
-rw-r--r--src/gui/image/qpixmap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 66a861d..1e502bd 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1177,8 +1177,12 @@ Qt::HANDLE QPixmap::handle() const
{
#if defined(Q_WS_X11)
const QPixmapData *pd = pixmapData();
- if (pd && pd->classId() == QPixmapData::X11Class)
- return static_cast<const QX11PixmapData*>(pd)->handle();
+ if (pd) {
+ if (pd->classId() == QPixmapData::X11Class)
+ return static_cast<const QX11PixmapData*>(pd)->handle();
+ else
+ qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap");
+ }
#endif
return 0;
}