diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-07 09:01:51 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:25:12 (GMT) |
commit | 0898c75343e9bd079da5a8253a82d68b45445713 (patch) | |
tree | 55c81f15bc8bf84de55bfa675f5ef9fc31a3bd51 | |
parent | 0819baa1207ebec7dd2da0f4efe445d2c94b3ee8 (diff) | |
download | Qt-0898c75343e9bd079da5a8253a82d68b45445713.zip Qt-0898c75343e9bd079da5a8253a82d68b45445713.tar.gz Qt-0898c75343e9bd079da5a8253a82d68b45445713.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
-rw-r--r-- | src/gui/image/qpixmap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 5ed351d..c67bedc 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); |