From 39f2c09d9154e00409c73c6f6db90a4ddb06b8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 7 Mar 2011 10:01:51 +0100 Subject: 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 --- src/gui/image/qpixmap.cpp | 7 +++++-- 1 file 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); -- cgit v0.12