Make qmovie autotest build without widgets

Change-Id: Ie53b183e99de08c3cc35f4932b7aabf4bf5b0940
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Kent Hansen 2012-06-05 13:34:33 +02:00 committed by Qt by Nokia
parent 22e6477185
commit 17e233e7c3
2 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,8 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qmovie
QT += widgets testlib
QT += testlib
!contains(QT_CONFIG, no-widgets): QT += widgets
SOURCES += tst_qmovie.cpp
MOC_DIR=tmp

View File

@ -44,7 +44,9 @@
#include <QIODevice>
#ifndef QT_NO_WIDGETS
#include <QLabel>
#endif
#include <QMovie>
class tst_QMovie : public QObject
@ -70,7 +72,9 @@ private slots:
void jumpToFrame_data();
void jumpToFrame();
void changeMovieFile();
#ifndef QT_NO_WIDGETS
void infiniteLoop();
#endif
};
// Testing get/set functions
@ -167,6 +171,7 @@ void tst_QMovie::playMovie()
connect(&movie, SIGNAL(finished()), this, SLOT(exitLoopSlot()));
#ifndef QT_NO_WIDGETS
QLabel label;
label.setMovie(&movie);
label.show();
@ -177,6 +182,7 @@ void tst_QMovie::playMovie()
QCOMPARE(movie.state(), QMovie::NotRunning);
QCOMPARE(movie.frameCount(), frameCount);
#endif
}
void tst_QMovie::jumpToFrame_data()
@ -203,6 +209,7 @@ void tst_QMovie::changeMovieFile()
QVERIFY(movie.currentFrameNumber() == -1);
}
#ifndef QT_NO_WIDGETS
void tst_QMovie::infiniteLoop()
{
QLabel label;
@ -214,6 +221,7 @@ void tst_QMovie::infiniteLoop()
QTestEventLoop::instance().enterLoop(1);
QTestEventLoop::instance().timeout();
}
#endif
QTEST_MAIN(tst_QMovie)
#include "tst_qmovie.moc"