diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-28 12:49:19 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-30 09:22:14 (GMT) |
commit | 79eef278228aac21fbf8b21eaa337f2922bc68c1 (patch) | |
tree | f5dee10e99a57e69713726d7195ccbd2df582677 /src/gui/image/qpixmap_x11.cpp | |
parent | 8efb1eb4b112dfe718f47a5b99cd9a839ac62752 (diff) | |
download | Qt-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.cpp | 7 |
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; |