Fix autotest gui/widgets dependencies

This is in preparation of removing testlib's
dependency on QtGui and QtWidgets.

Autotests that need QtWidgets api must
explicitly include it (since the types are no
longer provided by the QtGui master header).

Autotests that don't need QtGui or QtWidgets
api shouldn't link against those libraries.

Change-Id: I2808289068514fcac582808828ad4634e2631733
Reviewed-on: http://codereview.qt-project.org/5093
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Kent Hansen 2011-09-16 14:07:05 +02:00 committed by Qt by Nokia
parent 39a6ff81bc
commit b8d656d878
49 changed files with 59 additions and 17 deletions

View File

@ -45,12 +45,12 @@
#include <QtCore/QSettings>
#include <private/qsettings_p.h>
//#include <QtGui/QApplication>
#include <QtCore/QCoreApplication>
#include <QtCore/QtGlobal>
#include <QtCore/QMetaType>
#include <QtCore/QtDebug>
#include <QtCore/QString>
#include <QtGui/QKeySequence>
#include "../../../../shared/util.h"
#if !defined(Q_OS_SYMBIAN)

View File

@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include <QtCore/QtCore>
#include <QtSql/QtSql>
#include <QtWidgets/QtWidgets>
#include <QSortFilterProxyModel>
/*

View File

@ -3313,7 +3313,7 @@ void tst_QObject::deleteQObjectWhenDeletingEvent()
};
QObject o;
QApplication::postEvent(&o, new MyEvent);
QGuiApplication::postEvent(&o, new MyEvent);
QCoreApplication::removePostedEvents(&o); // here you would get a deadlock
}

View File

@ -1,4 +1,5 @@
load(qttest_p4)
QT = core
SOURCES += tst_qlist.cpp

View File

@ -40,6 +40,7 @@
****************************************************************************/
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <QtTest/QtTest>
#include <stddef.h>

View File

@ -1,3 +1,2 @@
TEMPLATE = subdirs
QT += widgets
SUBDIRS = test qfileopeneventexternal

View File

@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
#include <QEvent>
#include <QtGui/qevent.h>
#ifdef Q_OS_SYMBIAN
#include <apgcli.h>

View File

@ -40,6 +40,7 @@
****************************************************************************/
#include <QtGui>
#include <QtWidgets>
#include <QtTest>
class tst_QTouchEventWidget : public QWidget

View File

@ -44,6 +44,7 @@
#include "../../../../shared/util.h"
#include <qpainter.h>
#include <qdrawutil.h>
#include <qapplication.h>
#include <qwidget.h>
#include <qfontmetrics.h>

View File

@ -43,6 +43,8 @@
#if defined(Q_OS_WINCE)
#include <QtGui/QFontDatabase>
#endif
#include <QtGui/QFontInfo>
#include <QtGui/QFontMetrics>
//TESTED_CLASS=QCss
//TESTED_FILES=gui/text/qcssparser.cpp gui/text/qcssparser_p.h

View File

@ -44,6 +44,8 @@
#include <qfontdatabase.h>
#include <qfontinfo.h>
#include <qfontmetrics.h>
#ifdef Q_OS_SYMBIAN
#define SRCDIR "."
@ -232,7 +234,7 @@ void tst_QFontDatabase::addAppFont_data()
void tst_QFontDatabase::addAppFont()
{
QFETCH(bool, useMemoryFont);
QSignalSpy fontDbChangedSpy(QApplication::instance(), SIGNAL(fontDatabaseChanged()));
QSignalSpy fontDbChangedSpy(QGuiApplication::instance(), SIGNAL(fontDatabaseChanged()));
QFontDatabase db;

View File

@ -2469,7 +2469,7 @@ void tst_QTextDocumentFragment::html_anchorColor()
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\">Blue</a></span>");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().foreground().color() == QApplication::palette().link().color());
QVERIFY(cursor.charFormat().foreground().color() == QGuiApplication::palette().link().color());
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\" style=\"color: yellow;\">Green</a></span>");
cursor.movePosition(QTextCursor::Start);

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include "modeltest.h"
#include "dynamictreemodel.h"

View File

@ -44,6 +44,7 @@
#ifndef Q_OS_WINCE
#include "../../shared/util.h"
#include <QtGui>
#include <QtWidgets>
#include <math.h>
#if defined(Q_OS_WIN) && defined(interface)

View File

@ -47,6 +47,7 @@
#include "qabstracteventdispatcher.h"
#include <QtGui>
#include <QtWidgets>
#include "private/qapplication_p.h"
#include "private/qstylesheetstyle_p.h"

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
//TESTED_CLASS=
//TESTED_FILES=

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QColorDialog>
#include "../../shared/util.h"

View File

@ -38,11 +38,10 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "qcompleter.h"
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
#include <QtDebug>
#include <QPair>
#include <QList>

View File

@ -39,6 +39,7 @@
**
****************************************************************************/
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <QtTest/QtTest>
class tst_QDataWidgetMapper: public QObject

View File

@ -47,6 +47,10 @@
#include <qwindowsstyle.h>
#include <qsizepolicy.h>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QPlastiqueStyle>
#include <QtWidgets/QWindowsStyle>
#include <QStyleFactory>

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
#include <math.h>
#include "../../shared/util.h"

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
#include "../../shared/util.h"
#include <private/qgraphicsproxywidget_p.h>
#include <private/qlayoutengine_p.h> // qSmartMin functions...

View File

@ -46,6 +46,7 @@
#endif
#include <QtGui>
#include <QtWidgets>
#include <private/qgraphicsscene_p.h>
#include <private/qgraphicssceneindex_p.h>
#include <math.h>

View File

@ -48,6 +48,9 @@
#include <qsizepolicy.h>
//#include <QtGui>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QRadioButton>
#include <QtWidgets/QWindowsStyle>
#include <QStyleFactory>

View File

@ -45,6 +45,7 @@
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include "dynamictreemodel.h"
#include "qidentityproxymodel.h"

View File

@ -39,6 +39,7 @@
**
****************************************************************************/
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <QtTest/QtTest>
class tst_QItemEditorFactory: public QObject

View File

@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
//TESTED_CLASS=
//TESTED_FILES=

View File

@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include <QtCore/QtCore>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
/*
To add a view to be tested add the header file to the includes

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <qeventloop.h>
#include <qlist.h>

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
#include <QtCore>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>

View File

@ -41,6 +41,10 @@
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLPaintDevice>
#include <QtGui/QPainter>
#include <QtGui/QScreen>
#include <QtGui/QWindow>
#include <QtTest/QtTest>

View File

@ -40,6 +40,7 @@
****************************************************************************/
#include <QtGui>
#include <QtWidgets>
#include <QtTest>
// #include <QDebug>

View File

@ -48,7 +48,7 @@
#include <QtCore>
#include <QtGui>
#include <QtWidgets/QSortFilterProxyModel>
#include <QtWidgets>
#include <qdebug.h>

View File

@ -40,6 +40,7 @@
****************************************************************************/
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include <QtTest/QtTest>
#include <QtDebug>
#include <QMetaObject>

View File

@ -41,6 +41,7 @@
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <private/qtablewidget_p.h>
#include <QtTest/QtTest>
#include "../../shared/util.h"

View File

@ -45,6 +45,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include "../../shared/util.h"
//TESTED_CLASS=

View File

@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsqldatabase.cpp
QT += sql
QT = core sql
win32: {
!wince*: LIBS += -lws2_32

View File

@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsqldriver.cpp
QT += sql
QT = core sql
wince*: {
plugFiles.files = ../../../plugins/sqldrivers

View File

@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsqlfield.cpp
QT += sql
QT = core sql
symbian {
qt_not_deployed {

View File

@ -14,7 +14,7 @@ symbian {
TARGET.EPOCHEAPSIZE=50000 5000000
}
QT += sql
QT = core sql

View File

@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtGui>
#include <QtWidgets>
#include <qsqldriver.h>
#include <qsqldatabase.h>

View File

@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsqlrelationaltablemodel.cpp
QT += sql
QT = core sql
wince*: {
plugFiles.files = ../../../plugins/sqldrivers

View File

@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsqltablemodel.cpp
QT += sql
QT = core sql
wince*: {
plugFiles.files = ../../../plugins/sqldrivers

View File

@ -1,6 +1,6 @@
load(qttest_p4)
SOURCES += ../tst_selftests.cpp
QT += core xml testlib-private
QT = core xml testlib-private
TARGET = ../tst_selftests

View File

@ -1,4 +1,5 @@
load(qttest_p4)
QT = core
# this is not a real testcase ('make check' should not run it)
CONFIG -= testcase

View File

@ -20,6 +20,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n
if(*-g++*|*-icc*|*-clang|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h
SOURCES += tst_moc.cpp
QT -= gui
QT += sql network
contains(QT_CONFIG, dbus){
DEFINES += WITH_DBUS

View File

@ -1,5 +1,6 @@
CONFIG += qttest_p4
QT = core
TARGET = tst_rcc
SOURCES += tst_rcc.cpp

View File

@ -1,5 +1,6 @@
load(qttest_p4)
QT = core
SOURCES += tst_uic.cpp
TARGET = tst_uic

View File

@ -6,4 +6,4 @@ HEADERS += v8test.h
CONFIG += parallel_test
QT += v8-private
QT = core v8-private