summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-03-07 10:01:51 +0100
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 12:25:12 +0200
commit0898c75343e9bd079da5a8253a82d68b45445713 (patch)
tree55c81f15bc8bf84de55bfa675f5ef9fc31a3bd51
parent0819baa1207ebec7dd2da0f4efe445d2c94b3ee8 (diff)
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
-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 5ed351d840..c67bedc136 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);