From fe6fe39415aead498defc1bee01e760bb9295e21 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 5 Jun 2012 13:28:16 +0200 Subject: Make qpixmap autotest build without widgets Change-Id: Iabf1e6815a2af79d9da84c0e2bb9c2de52cb698f Reviewed-by: Lars Knoll --- tests/auto/gui/image/qpixmap/qpixmap.pro | 3 ++- tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro index 15098770c6..2ce6c6b9e7 100644 --- a/tests/auto/gui/image/qpixmap/qpixmap.pro +++ b/tests/auto/gui/image/qpixmap/qpixmap.pro @@ -1,7 +1,8 @@ CONFIG += testcase TARGET = tst_qpixmap -QT += core-private gui-private widgets widgets-private testlib +QT += core-private gui-private testlib +!contains(QT_CONFIG, no-widgets): QT += widgets widgets-private SOURCES += tst_qpixmap.cpp !wince* { diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index eeac564689..16fccb7491 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -46,9 +46,11 @@ #include #include #include +#ifndef QT_NO_WIDGETS #include -#include #include +#endif +#include #include #include @@ -153,7 +155,9 @@ private slots: void fromImageReaderAnimatedGif(); void preserveDepth(); +#ifndef QT_NO_WIDGETS void splash_crash(); +#endif void toImageDeepCopy(); @@ -720,6 +724,7 @@ void tst_QPixmap::grabWindow() { // ### fixme: Check platforms QSKIP("QTBUG-20863 grabWindow is broken on most qpa backends"); +#ifndef QT_NO_WIDGETS #ifdef Q_OS_WINCE // We get out of memory, if the desktop itself is too big. if (QApplication::desktop()->width() <= 480) @@ -747,6 +752,7 @@ void tst_QPixmap::grabWindow() QPixmap grabWindowPixmap = QPixmap::grabWindow(child.winId()); QPixmap grabWidgetPixmap = QPixmap::grabWidget(&child); lenientCompare(grabWindowPixmap, grabWidgetPixmap); +#endif } void tst_QPixmap::isNull() @@ -1203,6 +1209,7 @@ void tst_QPixmap::fromImage_crash() delete img; } +#ifndef QT_NO_WIDGETS //This is testing QPlatformPixmap::createCompatiblePlatformPixmap - see QTBUG-5977 void tst_QPixmap::splash_crash() { @@ -1213,6 +1220,7 @@ void tst_QPixmap::splash_crash() QCoreApplication::processEvents(); splash.close(); } +#endif void tst_QPixmap::fromData() { -- cgit v1.2.3