summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-03-07 09:01:51 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-03-07 09:24:33 (GMT)
commit39f2c09d9154e00409c73c6f6db90a4ddb06b8f0 (patch)
tree7bbeeedffe088ce4d6ee097e35328fe861d17a04 /src/gui/image
parent74a92ce0858b93a9c110c93bd0fb94163d1ee210 (diff)
downloadQt-39f2c09d9154e00409c73c6f6db90a4ddb06b8f0.zip
Qt-39f2c09d9154e00409c73c6f6db90a4ddb06b8f0.tar.gz
Qt-39f2c09d9154e00409c73c6f6db90a4ddb06b8f0.tar.bz2
Fixed auto-test failures caused by a3a79fefe65ec12.
QPixmaps might be unintentionally created through QVariant streaming for example, so to prevent breaking existing applications we should just use a warning instead, when creating a QPixmap in a non-GUI application. Task-number: QTBUG-17873 Reviewed-by: aavit
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 71fb079..be0ad4a 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -116,8 +116,11 @@ extern QApplication::Type qt_appType;
void QPixmap::init(int w, int h, int type)
{
- if (qt_appType == QApplication::Tty)
- qFatal("QPixmap: Cannot create a QPixmap when no GUI is being used");
+ if (qt_appType == QApplication::Tty) {
+ qWarning("QPixmap: Cannot create a QPixmap when no GUI is being used");
+ data = 0;
+ return;
+ }
if ((w > 0 && h > 0) || type == QPixmapData::BitmapType)
data = QPixmapData::create(w, h, (QPixmapData::PixelType) type);