summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_x11.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-28 12:49:19 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-30 09:22:14 (GMT)
commit79eef278228aac21fbf8b21eaa337f2922bc68c1 (patch)
treef5dee10e99a57e69713726d7195ccbd2df582677 /src/gui/image/qpixmap_x11.cpp
parent8efb1eb4b112dfe718f47a5b99cd9a839ac62752 (diff)
downloadQt-79eef278228aac21fbf8b21eaa337f2922bc68c1.zip
Qt-79eef278228aac21fbf8b21eaa337f2922bc68c1.tar.gz
Qt-79eef278228aac21fbf8b21eaa337f2922bc68c1.tar.bz2
Lazily construct QPixmapData's for null pixmaps
Reviewed-by: Trond
Diffstat (limited to 'src/gui/image/qpixmap_x11.cpp')
-rw-r--r--src/gui/image/qpixmap_x11.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index ea9eff9..8a0120a 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1976,6 +1976,9 @@ void QPixmap::x11SetScreen(int screen)
return;
}
+ if (isNull())
+ return;
+
if (data->classId() != QPixmapData::X11Class)
return;
@@ -2078,7 +2081,7 @@ bool QX11PixmapData::hasAlphaChannel() const
const QX11Info &QPixmap::x11Info() const
{
- if (data->classId() == QPixmapData::X11Class)
+ if (data && data->classId() == QPixmapData::X11Class)
return static_cast<QX11PixmapData*>(data.data())->xinfo;
else {
static QX11Info nullX11Info;
@@ -2135,7 +2138,7 @@ QPaintEngine* QX11PixmapData::paintEngine() const
Qt::HANDLE QPixmap::x11PictureHandle() const
{
#ifndef QT_NO_XRENDER
- if (data->classId() == QPixmapData::X11Class)
+ if (data && data->classId() == QPixmapData::X11Class)
return static_cast<const QX11PixmapData*>(data.data())->picture;
else
return 0;