diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-01-31 11:22:08 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2012-01-31 06:33:34 +0100 |
commit | dbf35e498db723ae9850686e462ec4f45bc7b67c (patch) | |
tree | cf1f98717e131f26e5a6d63f6693935b2fbdb76f /tests/auto | |
parent | 12a5ddf456ba8549645a8cb28a8b4ed6197a14da (diff) |
Modify QtQuick1 to build in Qt5
Change-Id: I1c5ccaef420e8f119e761f50b969127f430df7ba
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto')
154 files changed, 999 insertions, 887 deletions
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 08d59d34..7656c79a 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -65,7 +65,6 @@ contains(QT_CONFIG, private_tests) { qdeclarativesmoothedanimation \ qdeclarativespringanimation \ qdeclarativestyledtext \ - qdeclarativesqldatabase \ qdeclarativestates \ qdeclarativesystempalette \ qdeclarativetext \ diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index 1f257693..388c4eef 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_examples + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 macx:CONFIG -= app_bundle SOURCES += tst_examples.cpp diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index 790d3d9e..773b93ad 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -140,10 +140,8 @@ void tst_examples::namingConvention(const QDir &d) void tst_examples::namingConvention() { QString examples = QLibraryInfo::location(QLibraryInfo::ExamplesPath); - QString demos = QLibraryInfo::location(QLibraryInfo::DemosPath); namingConvention(QDir(examples)); - namingConvention(QDir(demos)); } QStringList tst_examples::findQmlFiles(const QDir &d) diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro index ff773e8f..a475cf64 100644 --- a/tests/auto/declarative/moduleqt47/moduleqt47.pro +++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_moduleqt47 + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 gui macx:CONFIG -= app_bundle SOURCES += tst_moduleqt47.cpp diff --git a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp index 3c6cbd9a..eab1bf3c 100644 --- a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp +++ b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include <qtest.h> #include <QDir> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro index 6ef2432b..ace91cd2 100644 --- a/tests/auto/declarative/parserstress/parserstress.pro +++ b/tests/auto/declarative/parserstress/parserstress.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_parserstress + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 macx:CONFIG -= app_bundle SOURCES += tst_parserstress.cpp diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index 33896d52..504e09e0 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -94,11 +94,7 @@ void tst_parserstress::ecmascript_data() #ifdef Q_OS_SYMBIAN QDir dir("tests"); #else - QDir dir(SRCDIR); - dir.cdUp(); - dir.cdUp(); - dir.cd("qscriptjstestsuite"); - dir.cd("tests"); + QDir dir(SRCDIR "../../qscriptjstestsuite/tests"); #endif QStringList files = findJSFiles(dir); @@ -110,6 +106,8 @@ void tst_parserstress::ecmascript_data() void tst_parserstress::ecmascript() { + QSKIP("Test data (located in the QtScript module) not currently available"); + QFETCH(QString, file); QFile f(file); diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro index f09e8d9f..e5299217 100644 --- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro +++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeanchors + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets widgets-private gui gui-private core-private SOURCES += tst_qdeclarativeanchors.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 17e5eb03..f5aeaa1f 100644 --- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -40,15 +40,15 @@ ****************************************************************************/ #include <qtest.h> #include <QSignalSpy> -#include <QtGui/QGraphicsWidget> +#include <QtWidgets/QGraphicsWidget> #include <private/qgraphicsitem_p.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativeanchors_p_p.h> -#include <QtDeclarative/private/qdeclarativeitem_p.h> +#include <QtQuick1/private/qdeclarativeanchors_p_p.h> +#include <QtQuick1/private/qdeclarativeitem_p.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro index 3d040a67..811fa4cb 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro +++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative network +CONFIG += testcase +TARGET = tst_qdeclarativeanimatedimage + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private network HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp index 19853c4e..147f8556 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp +++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp @@ -39,17 +39,16 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeimage_p.h> #include <private/qdeclarativeanimatedimage_p.h> #include <QSignalSpy> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativecontext.h> #include "../shared/testhttpserver.h" -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -191,6 +190,7 @@ void tst_qdeclarativeanimatedimage::mirror_running() QPixmap frame1_expected = frame1.transformed(transform); QCOMPARE(frame0_flipped, frame0_expected); + QEXPECT_FAIL("", "QTBUG-19538", Continue); QCOMPARE(frame1_flipped, frame1_expected); } diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro index d00d51a6..c0be3015 100644 --- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro +++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeanimations + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private core-private gui-private widgets-private SOURCES += tst_qdeclarativeanimations.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 4da59108..e4bb7b1f 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -39,17 +39,15 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeanimation_p.h> #include <private/qdeclarativeitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> -#include "../../../shared/util.h" - #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." diff --git a/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro index 91e54682..aff3d64a 100644 --- a/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro +++ b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeapplication + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 gui widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeapplication.cpp diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp index bb9967d6..cafcfba0 100644 --- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp +++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp @@ -40,12 +40,12 @@ ****************************************************************************/ #include <qtest.h> -#include "../../../shared/util.h" -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeitem.h> -#include <QtGui/qgraphicsview.h> -#include <QtGui/qgraphicsscene.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeitem.h> +#include <QtWidgets/qgraphicsview.h> +#include <QtWidgets/qgraphicsscene.h> +#include <QtWidgets/qapplication.h> class tst_qdeclarativeapplication : public QObject { diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro index 74168273..f2667acf 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro +++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativebehaviors + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private core-private widgets-private gui-private SOURCES += tst_qdeclarativebehaviors.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index 1c58ddb0..e193d34b 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -40,15 +40,14 @@ ****************************************************************************/ #include <qtest.h> #include <qsignalspy.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativetext_p.h> #include <private/qdeclarativebehavior_p.h> #include <private/qdeclarativeanimation_p.h> #include <private/qdeclarativeitem_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro index fe126356..e09d0a9d 100644 --- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro +++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativebinding + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativebinding.cpp diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp index 9d652556..be89fce6 100644 --- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp +++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp @@ -39,11 +39,10 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativebind_p.h> #include <private/qdeclarativerectangle_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro index c5b1bfa1..96bbc7c2 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro +++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativeborderimage + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets network macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index e8ebc34e..1658f8a6 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -46,16 +46,15 @@ #include <QGraphicsScene> #include <QPainter> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativeborderimage_p.h> #include <private/qdeclarativeimagebase_p.h> #include <private/qdeclarativescalegrid_p_p.h> #include <private/qdeclarativeloader_p.h> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativecontext.h> #include "../shared/testhttpserver.h" -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -249,6 +248,7 @@ void tst_qdeclarativeborderimage::mirror() p_screenshot.fillRect(QRect(0, 0, width, height), Qt::white); scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height)); + QEXPECT_FAIL("", "QTBUG-19538", Continue); QCOMPARE(screenshot, expected); delete obj; diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro index 4124f946..46914b82 100644 --- a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro +++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativecomponent + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 QT += script network macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp index 749640a7..e1152382 100644 --- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp +++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp @@ -41,11 +41,11 @@ #include <qtest.h> #include <QDebug> -#include <QtGui/qgraphicsitem.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeitem.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtWidgets/qgraphicsitem.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeitem.h> +#include <QtQuick1/qdeclarativeproperty.h> #include <qcolor.h> #ifdef Q_OS_SYMBIAN diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro index 6f9550d3..c38b80c8 100644 --- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro +++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeconnection + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui core-private script-private gui-private widgets-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeconnection.cpp diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp index e42e906d..13e9e67e 100644 --- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp +++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp @@ -39,12 +39,11 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativeconnections_p.h> #include <private/qdeclarativeitem_p.h> -#include "../../../shared/util.h" -#include <QtDeclarative/qdeclarativescriptstring.h> +#include <QtQuick1/qdeclarativescriptstring.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro index 74bb78c6..f8856e72 100644 --- a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro +++ b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativecontext + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 SOURCES += tst_qdeclarativecontext.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro index d488b53c..78bb8d35 100644 --- a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro +++ b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro @@ -1,10 +1,13 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += network declarative +CONFIG += testcase +TARGET = tst_qdeclarativedebug + +QT += testlib +contains(QT_CONFIG,quick1): QT += network quick1 quick1-private core-private script-private gui-private widgets-private macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebug.cpp \ ../shared/debugutil.cpp -CONFIG += parallel_test declarative_debug +CONFIG += parallel_test quick1_debug diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 83d47fca..eb8e8d87 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -45,11 +45,11 @@ #include <QDebug> #include <QThread> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativeproperty.h> #include <private/qdeclarativebinding_p.h> #include <private/qdeclarativeenginedebug_p.h> @@ -59,7 +59,6 @@ #include <private/qdeclarativemetatype_p.h> #include <private/qdeclarativeproperty_p.h> -#include "../../../shared/util.h" #include "../shared/debugutil_p.h" Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State) diff --git a/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro index 8fa87d29..db98ab09 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro +++ b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro @@ -1,9 +1,12 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += network declarative +CONFIG += testcase +TARGET = tst_qdeclarativedebugclient + +QT += testlib +contains(QT_CONFIG,quick1): QT += network quick1 quick1-private core-private gui-private widgets-private macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebugclient.cpp \ ../shared/debugutil.cpp -CONFIG += declarative_debug +CONFIG += quick1_debug diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index 43b6b654..0570e2fd 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -45,11 +45,10 @@ #include <QDebug> #include <QThread> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeengine.h> #include <private/qdeclarativedebugclient_p.h> -#include "../../../shared/util.h" #include "../shared/debugutil_p.h" class tst_QDeclarativeDebugClient : public QObject diff --git a/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro b/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro index c52c6524..83fe5b62 100644 --- a/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro +++ b/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += network declarative script +CONFIG += testcase +TARGET = tst_qdeclarativedebughelper + +QT += testlib +contains(QT_CONFIG,quick1): QT += network quick1 quick1-private script script-private core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativedebughelper.cpp diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro index d1c0cddf..8eb3dfa1 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro +++ b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro @@ -1,7 +1,7 @@ TEMPLATE = app -QT += declarative -CONFIG += declarative_debug +QT += quick1 quick1-private gui widgets +CONFIG += quick1_debug CONFIG += console CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp index 18a7a5f8..8a33335d 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp +++ b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp @@ -44,7 +44,7 @@ #include <QDeclarativeComponent> #include <QDeclarativeEngine> #include <QStringList> -#include <QtDeclarative/private/qdeclarativedebugservice_p.h> +#include <QtQuick1/private/qdeclarativedebugservice_p.h> int main(int argc, char *argv[]) { diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp index 096f3905..aec1dcf0 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -40,14 +40,13 @@ ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/QDeclarativeEngine> -#include <QtDeclarative/private/qdeclarativedebugclient_p.h> -#include <QtDeclarative/private/qdeclarativedebugservice_p.h> -#include <QtDeclarative/private/qjsdebuggeragent_p.h> +#include <QtQuick1/QDeclarativeEngine> +#include <QtQuick1/private/qdeclarativedebugclient_p.h> +#include <QtQuick1/private/qdeclarativedebugservice_p.h> +#include <QtQuick1/private/qjsdebuggeragent_p.h> #include <QtCore/QFileInfo> #include <QtCore/QDir> #include <QtCore/QProcess> -#include "../../../shared/util.h" #include "../shared/debugutil_p.h" class QJSDebugClient : public QDeclarativeDebugClient diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro index c293fea7..98f96f82 100644 --- a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro +++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative network script +CONFIG += testcase +TARGET = tst_qdeclarativedebugjs + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private network script core-private gui-private widgets-private macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h diff --git a/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro index ca5a3988..94bbf7aa 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro +++ b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro @@ -1,10 +1,13 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += network declarative +CONFIG += testcase +TARGET = tst_qdeclarativedebugservice + +QT += testlib +contains(QT_CONFIG,quick1): QT += network quick1 quick1-private core-private gui-private widgets-private macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h SOURCES += tst_qdeclarativedebugservice.cpp \ ../shared/debugutil.cpp -CONFIG += parallel_test declarative_debug +CONFIG += parallel_test quick1_debug diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index ff73c5c0..87636c8b 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -45,12 +45,11 @@ #include <QDebug> #include <QThread> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeengine.h> #include <private/qdeclarativedebugclient_p.h> #include <private/qdeclarativedebugservice_p.h> -#include "../../../shared/util.h" #include "../shared/debugutil_p.h" diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro index 8ac69aac..55bbb848 100644 --- a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro +++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativedom + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativedom.cpp diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp index 14f1fb50..b8bb3589 100644 --- a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp +++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/private/qdeclarativedom_p.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/private/qdeclarativedom_p.h> #include <QtCore/QDebug> #include <QtCore/QFile> diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro index 69d25a42..a65b723e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro +++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script network +CONFIG += testcase +TARGET = tst_qdeclarativeecmascript + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script script-private network widgets core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeecmascript.cpp \ diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 8c7326f6..5c696c9c 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -42,19 +42,19 @@ #define TESTTYPES_H #include <QtCore/qobject.h> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarative.h> +#include <QtQuick1/qdeclarativeexpression.h> #include <QtCore/qpoint.h> #include <QtCore/qsize.h> -#include <QtDeclarative/qdeclarativelist.h> +#include <QtQuick1/qdeclarativelist.h> #include <QtCore/qrect.h> #include <QtGui/qmatrix.h> #include <QtGui/qcolor.h> #include <QtGui/qvector3d.h> #include <QtCore/qdatetime.h> #include <QtScript/qscriptvalue.h> -#include <QtDeclarative/qdeclarativescriptstring.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativescriptstring.h> +#include <QtQuick1/qdeclarativecomponent.h> class MyQmlAttachedObject : public QObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index f5b2061d..f8731f9f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativecontext.h> #include <QtCore/qfileinfo.h> #include <QtCore/qdebug.h> -#include <QtDeclarative/private/qdeclarativeguard_p.h> +#include <QtQuick1/private/qdeclarativeguard_p.h> #include <QtCore/qdir.h> #include <QtCore/qnumeric.h> #include <private/qdeclarativeengine_p.h> @@ -53,7 +53,6 @@ #include <private/qscriptdeclarativeclass_p.h> #include "testtypes.h" #include "testhttpserver.h" -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro index 7119ad99..d79d6c1e 100644 --- a/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro +++ b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative network +CONFIG += testcase +TARGET = tst_qdeclarativeengine + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 network macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeengine.cpp diff --git a/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro index 0c7240a0..76277bd7 100644 --- a/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro +++ b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeerror + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 SOURCES += tst_qdeclarativeerror.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro index c176e072..cfa1c50d 100644 --- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro +++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeflickable + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets script-private core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflickable.cpp diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index 748760a9..ef715a24 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -40,14 +40,15 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativeflickable_p.h> #include <private/qdeclarativevaluetype_p.h> -#include <QtGui/qgraphicswidget.h> +#include <QtWidgets/qgraphicswidget.h> +#include <QWindow> +#include <QApplication> #include <math.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro index 3b6d19a6..21ab151a 100644 --- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro +++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeflipable + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflipable.cpp diff --git a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp index 1835c656..8b39cf71 100644 --- a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp +++ b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativeflipable_p.h> #include <private/qdeclarativevaluetype_p.h> #include <QFontMetrics> diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro index eab983ff..0c9a16ca 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro +++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativefocusscope + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets SOURCES += tst_qdeclarativefocusscope.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp index 78aa5a9e..d6e7ea6d 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp +++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp @@ -40,13 +40,14 @@ ****************************************************************************/ #include <qtest.h> #include <QSignalSpy> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QGuiApplication> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativetextedit_p.h> #include <private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativefocusscope_p.h> +#include <QtQuick1/private/qdeclarativefocusscope_p.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro index b7e5e5fc..ce5f5087 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativefolderlistmodel + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativefolderlistmodel.cpp diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp index bfccc8af..a07cda84 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp @@ -40,9 +40,8 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include "../../../shared/util.h" -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <QtCore/qdir.h> #include <QtCore/qfile.h> #include <QtCore/qabstractitemmodel.h> diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro index 357268b2..70e6379b 100644 --- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro +++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativefontloader + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui network macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index 4d024c78..0b718740 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -40,11 +40,10 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> #include <private/qdeclarativefontloader_p.h> -#include "../../../shared/util.h" #include "../shared/testhttpserver.h" #define SERVER_PORT 14448 diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro index bc196fb5..4d86f271 100644 --- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro +++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativegridview + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets widgets-private gui gui-private core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativegridview.cpp diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index aa7f116f..2e3b8b25 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -40,18 +40,17 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/qstringlistmodel.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qdeclarativeitem_p.h> -#include <QtDeclarative/private/qlistmodelinterface_p.h> -#include <QtDeclarative/private/qdeclarativegridview_p.h> -#include <QtDeclarative/private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativelistmodel_p.h> -#include "../../../shared/util.h" +#include <QtCore/qstringlistmodel.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/private/qdeclarativeitem_p.h> +#include <QtQuick1/private/qlistmodelinterface_p.h> +#include <QtQuick1/private/qdeclarativegridview_p.h> +#include <QtQuick1/private/qdeclarativetext_p.h> +#include <QtQuick1/private/qdeclarativelistmodel_p.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.png b/tests/auto/declarative/qdeclarativeimage/data/heart.png Binary files differindex abe97fee..45db733f 100644 --- a/tests/auto/declarative/qdeclarativeimage/data/heart.png +++ b/tests/auto/declarative/qdeclarativeimage/data/heart.png diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200.png b/tests/auto/declarative/qdeclarativeimage/data/heart200.png Binary files differindex 7fbb13c5..e125d3a3 100644 --- a/tests/auto/declarative/qdeclarativeimage/data/heart200.png +++ b/tests/auto/declarative/qdeclarativeimage/data/heart200.png diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro index 5bf8095f..650b25d7 100644 --- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro +++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativeimage + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets network macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 48e81510..ab82f805 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -44,17 +44,16 @@ #include <QTcpSocket> #include <QDir> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativeimage_p.h> #include <private/qdeclarativeimagebase_p.h> #include <private/qdeclarativeloader_p.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> #include <QtTest/QSignalSpy> -#include "../../../shared/util.h" #include "../shared/testhttpserver.h" #ifdef Q_OS_SYMBIAN @@ -327,6 +326,7 @@ void tst_qdeclarativeimage::mirror() p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); break; case QDeclarativeImage::PreserveAspectFit: + QEXPECT_FAIL("", "QTBUG-19538", Continue); p_e.drawPixmap(QRect(25, 0, width / (width/height), height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); break; case QDeclarativeImage::PreserveAspectCrop: diff --git a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro index 3bf0ea13..29a9ea93 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro +++ b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeimageprovider + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private QT += network macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index b2e5c4e2..4d32e335 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -40,12 +40,11 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QtTest> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeimageprovider.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeimageprovider.h> #include <private/qdeclarativeimage_p.h> #include <QImageReader> #include <QWaitCondition> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro index 423390f1..e464fa8c 100644 --- a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro +++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeinfo + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeinfo.cpp diff --git a/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro index c8a48c94..de77b722 100644 --- a/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro +++ b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script +CONFIG += testcase +TARGET = tst_qdeclarativeinstruction + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script script-private core-private SOURCES += tst_qdeclarativeinstruction.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro index d8007a09..46208178 100644 --- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro +++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeitem + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui gui-private widgets-private core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeitem.cpp diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 80a22332..daa195b0 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -40,13 +40,12 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeitem_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro index cae85a7b..14439a38 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro +++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativelanguage + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script-private core-private QT += script network macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index 6f21e48c..3438d1da 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -47,12 +47,12 @@ #include <QtGui/qmatrix.h> #include <QtGui/qcolor.h> #include <QtGui/qvector3d.h> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeparserstatus.h> -#include <QtDeclarative/qdeclarativepropertyvaluesource.h> -#include <QtDeclarative/qdeclarativescriptstring.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtQuick1/qdeclarative.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeparserstatus.h> +#include <QtQuick1/qdeclarativepropertyvaluesource.h> +#include <QtQuick1/qdeclarativescriptstring.h> +#include <QtQuick1/qdeclarativeproperty.h> #include <private/qdeclarativecustomparser_p.h> diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index bfc0a5f1..e62d5dbe 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <QtCore/qfile.h> #include <QtCore/qdebug.h> #include <QtCore/qfileinfo.h> @@ -52,7 +52,6 @@ #include "testtypes.h" -#include "../../../shared/util.h" #include "testhttpserver.h" #ifdef Q_OS_SYMBIAN diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro index d89f16cd..d07cdad3 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro +++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativelayoutitem + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelayoutitem.cpp diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp index 83848b34..a194e86a 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp +++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp @@ -47,7 +47,6 @@ #include <qgraphicsscene.h> #include <qgraphicswidget.h> #include <qgraphicslinearlayout.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro index b5c5cf24..9c27e63d 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro +++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativelistmodel + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script-private core-private gui-private widgets-private QT += script macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 3c410020..b0f60192 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/private/qdeclarativeitem_p.h> -#include <QtDeclarative/private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativeengine_p.h> -#include <QtDeclarative/private/qdeclarativelistmodel_p.h> -#include <QtDeclarative/private/qdeclarativeexpression_p.h> +#include <QtQuick1/private/qdeclarativeitem_p.h> +#include <QtQuick1/private/qdeclarativetext_p.h> +#include <QtQuick1/private/qdeclarativeengine_p.h> +#include <QtQuick1/private/qdeclarativelistmodel_p.h> +#include <QtQuick1/private/qdeclarativeexpression_p.h> #include <QDeclarativeComponent> #include <QtCore/qtimer.h> @@ -51,8 +51,6 @@ #include <QtCore/qtranslator.h> #include <QSignalSpy> -#include "../../../shared/util.h" - #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." diff --git a/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro b/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro index f3e6f529..cc87f2d5 100644 --- a/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro +++ b/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativelistreference + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelistreference.cpp diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp index 4d3a0576..d47bdab3 100644 --- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp +++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp @@ -45,9 +45,9 @@ #include <QDir> #include <QDeclarativeEngine> #include <QDeclarativeComponent> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeprivate.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtQuick1/qdeclarative.h> +#include <QtQuick1/qdeclarativeprivate.h> +#include <QtQuick1/qdeclarativeproperty.h> #include <QDebug> inline QUrl TEST_FILE(const QString &filename) diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro index 1633ffca..74525deb 100644 --- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro +++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativelistview + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets widgets-private gui-private core-private script-private macx:CONFIG -= app_bundle HEADERS += incrementalmodel.h diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 31a8e2d9..08a3e000 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -40,18 +40,17 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/QStringListModel> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qdeclarativeitem_p.h> -#include <QtDeclarative/private/qdeclarativelistview_p.h> -#include <QtDeclarative/private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativevisualitemmodel_p.h> -#include <QtDeclarative/private/qdeclarativelistmodel_p.h> -#include <QtDeclarative/private/qlistmodelinterface_p.h> -#include "../../../shared/util.h" +#include <QtCore/QStringListModel> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/private/qdeclarativeitem_p.h> +#include <QtQuick1/private/qdeclarativelistview_p.h> +#include <QtQuick1/private/qdeclarativetext_p.h> +#include <QtQuick1/private/qdeclarativevisualitemmodel_p.h> +#include <QtQuick1/private/qdeclarativelistmodel_p.h> +#include <QtQuick1/private/qlistmodelinterface_p.h> #include "incrementalmodel.h" #ifdef Q_OS_SYMBIAN diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro index 1ede5096..f75dc602 100644 --- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro +++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativeloader + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui network macx:CONFIG -= app_bundle INCLUDEPATH += ../shared/ diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 186926e3..2b93a050 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -39,15 +39,14 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtGui/QGraphicsWidget> -#include <QtGui/QGraphicsScene> +#include <QtWidgets/QGraphicsWidget> +#include <QtWidgets/QGraphicsScene> #include <QSignalSpy> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativeloader_p.h> #include "testhttpserver.h" -#include "../../../shared/util.h" #define SERVER_PORT 14450 diff --git a/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro index f13250e2..87f95ed0 100644 --- a/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro +++ b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativemetatype + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets SOURCES += tst_qdeclarativemetatype.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp index e8ca4444..38d5adbe 100644 --- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp +++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp @@ -50,6 +50,9 @@ #include <QVector3D> #include <QVector4D> #include <QQuaternion> +#include <QPalette> +#include <QIcon> +#include <QCursor> #include <qdeclarative.h> #include <private/qdeclarativemetatype_p.h> diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro index 661675ae..e9dcb87f 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType.2.1 symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp index 4774c329..fd349c3d 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class MyPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro index d2546429..ff667b80 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType.2 symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp index 271c59e5..cf0ce7de 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class MyPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp index f023963b..355e085e 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class MyPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro index 173a3026..5ccaf8d3 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp index 460bcf87..aeff685e 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class BarPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro index 9766003e..d83ab1e0 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestQmlMixedPluginType symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp index 427bf648..21e3ba69 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class FloorPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro index 70a38b9a..33334d9b 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestQmlVersionPluginType symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp index 1b5a9d85..da05e477 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class MyPlugin : public QDeclarativeExtensionPlugin diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro index aa9c95c4..62f090a6 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 DESTDIR = ../imports/com/nokia/AutoTestPluginWithQmlFile symbian: { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp index 8397dbf3..f0a1527b 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQuick1/qdeclarativeextensionplugin.h> +#include <QtQuick1/qdeclarative.h> #include <QDebug> class MyPluginType : public QObject diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro index c7337ca0..31a4464d 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += plugin SOURCES = plugin.cpp -QT = core declarative +QT = core quick1 TARGET = Plugin DESTDIR = ../imports/com/nokia/WrongCase diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro index 6e72d983..248da333 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro @@ -1,4 +1,4 @@ -QT = core +QT = core testlib TEMPLATE = subdirs SUBDIRS = plugin plugin.2 plugin.2.1 pluginWrongCase pluginWithQmlFile pluginMixed pluginVersion tst_qdeclarativemoduleplugin_pro.depends += plugin diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index cc22da45..f7a4075b 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -40,13 +40,12 @@ ****************************************************************************/ #include <qtest.h> #include <qdir.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <QDebug> #include <QtCore/qlibraryinfo.h> #include "../shared/testhttpserver.h" -#include "../../../shared/util.h" #define SERVER_ADDR "http://127.0.0.1:14450" #define SERVER_PORT 14450 diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro index 98cd4729..79116058 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro @@ -1,10 +1,12 @@ -load(qttest_p4) +CONFIG += testcase +TARGET = tst_qdeclarativemoduleplugin + +QT += quick1 network testlib +CONFIG -= app_bundle HEADERS = ../shared/testhttpserver.h SOURCES = tst_qdeclarativemoduleplugin.cpp \ ../shared/testhttpserver.cpp -QT += declarative network -CONFIG -= app_bundle symbian: { importFiles.files = data diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro index ed9313fe..731b0906 100644 --- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro +++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativemousearea + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private widgets gui network macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 078fa12c..1da7c21c 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -41,13 +41,14 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> +#include <QApplication> #include <private/qdeclarativemousearea_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeflickable_p.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeproperty.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro index 2cf82683..3b43ef62 100644 --- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro +++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeparticles + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeparticles.cpp diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro index e0404c55..e4cccef0 100644 --- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro +++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativepathview + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepathview.cpp diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index cb5b135e..1d40520c 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -40,24 +40,22 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qdeclarativepathview_p.h> -#include <QtDeclarative/private/qdeclarativepath_p.h> -#include <QtDeclarative/private/qdeclarativetext_p.h> -#include <QtDeclarative/private/qdeclarativerectangle_p.h> -#include <QtDeclarative/private/qdeclarativelistmodel_p.h> -#include <QtDeclarative/private/qdeclarativevaluetype_p.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/private/qdeclarativepathview_p.h> +#include <QtQuick1/private/qdeclarativepath_p.h> +#include <QtQuick1/private/qdeclarativetext_p.h> +#include <QtQuick1/private/qdeclarativerectangle_p.h> +#include <QtQuick1/private/qdeclarativelistmodel_p.h> +#include <QtQuick1/private/qdeclarativevaluetype_p.h> #include <QAbstractListModel> #include <QStringListModel> #include <QStandardItemModel> #include <QFile> -#include "../../../shared/util.h" - #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro index 3bdb3fcc..d2bf9889 100644 --- a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro +++ b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativepincharea + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepincharea.cpp diff --git a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp index 4f63240d..bab6079d 100644 --- a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp +++ b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp @@ -41,11 +41,12 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> +#include <QWidget> #include <private/qdeclarativepincharea_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeflickable_p.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativecontext.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -55,7 +56,16 @@ class tst_QDeclarativePinchArea: public QObject { Q_OBJECT +public: + tst_QDeclarativePinchArea() : device(0) { } private slots: + void initTestCase() { + if (!device) { + device = new QTouchDevice; + device->setType(QTouchDevice::TouchScreen); + QWindowSystemInterface::registerTouchDevice(device); + } + } void pinchProperties(); void scale(); void pan(); @@ -63,6 +73,7 @@ private slots: private: QDeclarativeView *createView(); + QTouchDevice *device; }; void tst_QDeclarativePinchArea::pinchProperties() @@ -218,17 +229,17 @@ void tst_QDeclarativePinchArea::scale() QPoint p1(80, 80); QPoint p2(100, 100); - QTest::touchEvent(vp).press(0, p1); - QTest::touchEvent(vp).stationary(0).press(1, p2); + QTest::touchEvent(vp, device).press(0, p1, canvas); + QTest::touchEvent(vp, device).stationary(0).press(1, p2, canvas); p1 -= QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(root->property("scale").toReal(), 1.0); p1 -= QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(root->property("scale").toReal(), 1.5); QCOMPARE(root->property("center").toPointF(), QPointF(40, 40)); // blackrect is at 50,50 @@ -237,11 +248,11 @@ void tst_QDeclarativePinchArea::scale() // scale beyond bound p1 -= QPoint(50,50); p2 += QPoint(50,50); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(blackRect->scale(), 2.0); - QTest::touchEvent(vp).release(0, p1).release(1, p2); + QTest::touchEvent(vp, device).release(0, p1, canvas).release(1, p2, canvas); delete canvas; } @@ -273,17 +284,17 @@ void tst_QDeclarativePinchArea::pan() QPoint p1(80, 80); QPoint p2(100, 100); - QTest::touchEvent(vp).press(0, p1); - QTest::touchEvent(vp).stationary(0).press(1, p2); + QTest::touchEvent(vp, device).press(0, p1, canvas); + QTest::touchEvent(vp, device).stationary(0).press(1, p2, canvas); p1 += QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(root->property("scale").toReal(), 1.0); p1 += QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(root->property("center").toPointF(), QPointF(60, 60)); // blackrect is at 50,50 @@ -293,12 +304,12 @@ void tst_QDeclarativePinchArea::pan() // pan x beyond bound p1 += QPoint(100,100); p2 += QPoint(100,100); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(blackRect->x(), 140.0); QCOMPARE(blackRect->y(), 160.0); - QTest::touchEvent(vp).release(0, p1).release(1, p2); + QTest::touchEvent(vp, device).release(0, p1, canvas).release(1, p2, canvas); delete canvas; } @@ -328,24 +339,24 @@ void tst_QDeclarativePinchArea::flickable() // begin by moving one touch point (mouse) QTest::mousePress(vp, Qt::LeftButton, 0, canvas->mapFromScene(p1)); - QTest::touchEvent(vp).press(0, p1); + QTest::touchEvent(vp, device).press(0, p1, canvas); { p1 -= QPoint(10,10); QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); QApplication::sendEvent(canvas->viewport(), &mv); - QTest::touchEvent(vp).move(0, p1); + QTest::touchEvent(vp, device).move(0, p1, canvas); } { p1 -= QPoint(10,10); QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); QApplication::sendEvent(vp, &mv); - QTest::touchEvent(vp).move(0, p1); + QTest::touchEvent(vp, device).move(0, p1, canvas); } { p1 -= QPoint(10,10); QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); QApplication::sendEvent(vp, &mv); - QTest::touchEvent(vp).move(0, p1); + QTest::touchEvent(vp, device).move(0, p1, canvas); } // Flickable has reacted to the gesture @@ -353,23 +364,23 @@ void tst_QDeclarativePinchArea::flickable() QVERIFY(root->property("scale").toReal() == 1.0); // add another touch point and continue moving - QTest::touchEvent(vp).stationary(0).press(1, p2); + QTest::touchEvent(vp, device).stationary(0).press(1, p2, canvas); p1 -= QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); QCOMPARE(root->property("scale").toReal(), 1.0); p1 -= QPoint(10,10); p2 += QPoint(10,10); - QTest::touchEvent(vp).move(0, p1).move(1, p2); + QTest::touchEvent(vp, device).move(0, p1, canvas).move(1, p2, canvas); // PinchArea has stolen the gesture. QVERIFY(!root->isMoving()); QVERIFY(root->property("scale").toReal() > 1.0); QTest::mouseRelease(vp, Qt::LeftButton, 0, canvas->mapFromScene(p1)); - QTest::touchEvent(vp).release(0, p1).release(1, p2); + QTest::touchEvent(vp, device).release(0, p1, canvas).release(1, p2, canvas); delete canvas; } diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro index 88871e95..153833c5 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro +++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro @@ -1,6 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -QT += network +CONFIG += testcase +TARGET = tst_qdeclarativeviewer + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private network macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepixmapcache.cpp diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp index 6609485f..68f1ef86 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp +++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp @@ -41,11 +41,10 @@ #include <qtest.h> #include <QtTest/QtTest> #include <private/qdeclarativepixmapcache_p.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeimageprovider.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeimageprovider.h> #include <QNetworkReply> #include "testhttpserver.h" -#include "../../../shared/util.h" #ifndef QT_NO_CONCURRENT #include <qtconcurrentrun.h> diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro index 27e59485..7249c2d0 100644 --- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro +++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativepositioners + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private core-private gui-private widgets-private SOURCES += tst_qdeclarativepositioners.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index 31a49391..e0b5310c 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -47,8 +47,7 @@ #include <private/qdeclarativetransition_p.h> #include <private/qdeclarativeitem_p.h> #include <qdeclarativeexpression.h> -#include <QtGui/qgraphicswidget.h> -#include "../../../shared/util.h" +#include <QtWidgets/qgraphicswidget.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro index 17508602..6c4d5604 100644 --- a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro +++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativeproperty + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script-private core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeproperty.cpp diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp index 1f464bfd..3b524a48 100644 --- a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp +++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeproperty.h> -#include <QtDeclarative/private/qdeclarativeproperty_p.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeproperty.h> +#include <QtQuick1/private/qdeclarativeproperty_p.h> #include <private/qdeclarativebinding_p.h> -#include <QtGui/QLineEdit> +#include <QtWidgets/QLineEdit> #include <QtCore/qfileinfo.h> #include <QtCore/qdir.h> diff --git a/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro b/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro index 3c0f7b34..f8ffe298 100644 --- a/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro +++ b/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativepropertymap + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepropertymap.cpp diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp index 33a66891..66b3d6ea 100644 --- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp +++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativepropertymap.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativepropertymap.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativetext_p.h> #include <QSignalSpy> diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro index 4b197ebf..73448609 100644 --- a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro +++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script +CONFIG += testcase +TARGET = tst_qdeclarativeqt + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script script-private core-private SOURCES += tst_qdeclarativeqt.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro index 5230f698..dcedb155 100644 --- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro +++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativerepeater + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativerepeater.cpp diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 1e2a4adf..db94f0e1 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -42,10 +42,10 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> #include <private/qlistmodelinterface_p.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> #include <private/qdeclarativerepeater_p.h> #include <private/qdeclarativetext_p.h> diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro index 1e77d6eb..b230d801 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativesmoothedanimation + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesmoothedanimation.cpp diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp index c779c8f8..eae51192 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp @@ -39,12 +39,11 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativesmoothedanimation_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativevaluetype_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro index da477fce..cc96cf2e 100644 --- a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro +++ b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativespringanimation + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativespringanimation.cpp diff --git a/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp b/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp index d97705af..053bafd2 100644 --- a/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp +++ b/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp @@ -39,11 +39,10 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativespringanimation_p.h> #include <private/qdeclarativevaluetype_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro index 4a0cc24b..2c4c63ba 100644 --- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro +++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativestates + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private core-private script-private widgets-private gui-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativestates.cpp diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index eb2558b0..1cf84535 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativeanchors_p_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeimage_p.h> diff --git a/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro b/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro index 87d0e5b5..120f7315 100644 --- a/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro +++ b/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativestyledtext + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private QT += network macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro index 00626884..3e2a44e6 100644 --- a/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro +++ b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativesystempalette + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesystempalette.cpp diff --git a/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp index 99490c22..6ee3fd41 100644 --- a/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp +++ b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp @@ -41,11 +41,10 @@ #include <qtest.h> #include <QDebug> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativesystempalette_p.h> #include <qpalette.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro index c0831f70..b0155932 100644 --- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro +++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativetext + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui gui-private widgets widgets-private core-private script-private QT += network macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index af354166..0d0eb63c 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include <qtest.h> #include <QTextDocument> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativetext_p.h> #include <private/qdeclarativetext_p_p.h> #include <private/qdeclarativevaluetype_p.h> @@ -52,7 +52,6 @@ #include <private/qapplication_p.h> #include <limits.h> -#include "../../../shared/util.h" #include "testhttpserver.h" #ifdef Q_OS_SYMBIAN diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro index aaf753e6..af7f9893 100644 --- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro +++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui network +CONFIG += testcase +TARGET = tst_qdeclarativetextedit + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui gui-private widgets widgets-private network core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 31da8323..c165e624 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -40,26 +40,26 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include "../../../shared/util.h" #include "../shared/testhttpserver.h" #include <math.h> #include <QFile> #include <QTextDocument> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativetextedit_p.h> #include <private/qdeclarativetextedit_p_p.h> #include <QFontMetrics> -#include <QDeclarativeView> +#include <QtQuick1/QDeclarativeView> #include <QDir> #include <QStyle> -#include <QInputContext> #include <QClipboard> #include <QMimeData> #include <private/qapplication_p.h> +#include <private/qinputpanel_p.h> #include <private/qtextcontrol_p.h> +#include "../shared/platforminputcontext.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -84,6 +84,15 @@ QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& return expectfile; } +void sendPreeditText(const QString &text, int cursor) +{ + QList<QInputMethodEvent::Attribute> attributes; + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursor, + text.length(), QVariant())); + QInputMethodEvent event(text, attributes); + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &event); +} + class tst_qdeclarativetextedit : public QObject @@ -93,6 +102,8 @@ public: tst_qdeclarativetextedit(); private slots: + void cleanup(); + void text(); void width(); void wrap(); @@ -221,6 +232,13 @@ tst_qdeclarativetextedit::tst_qdeclarativetextedit() // } +void tst_qdeclarativetextedit::cleanup() +{ + // ensure not even skipped tests with custom input context leave it dangling + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = 0; +} + void tst_qdeclarativetextedit::text() { { @@ -547,11 +565,11 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based - // keyboard input direction from QApplication::keyboardInputDirection + // keyboard input direction from QInputPanel::inputDirection textEdit->setText(""); - QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textEdit->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight); - if (QApplication::keyboardInputDirection() == Qt::LeftToRight) + if (qApp->inputPanel()->inputDirection() == Qt::LeftToRight) QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); else QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); @@ -568,7 +586,7 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create()); - QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textObject->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight); delete textObject; #endif @@ -1632,6 +1650,7 @@ void tst_qdeclarativetextedit::positionAt() QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject()); QVERIFY(texteditObject != 0); + /* QFontMetrics fm(texteditObject->font()); const int y0 = fm.height() / 2; const int y1 = fm.height() * 3 / 2; @@ -1645,6 +1664,24 @@ void tst_qdeclarativetextedit::positionAt() #else QVERIFY(diff < 5); #endif + */ + QTextLayout layout(texteditObject->text()); + layout.setFont(texteditObject->font()); + + layout.beginLayout(); + QTextLine line = layout.createLine(); + layout.endLayout(); + + const int y0 = line.height() / 2; + const int y1 = line.height() * 3 / 2; + + int pos = texteditObject->positionAt(texteditObject->width()/2, y0); + + int widthBegin = floor(line.cursorToX(pos - 1)); + int widthEnd = ceil(line.cursorToX(pos + 1)); + + QVERIFY(widthBegin <= texteditObject->width() / 2); + QVERIFY(widthEnd >= texteditObject->width() / 2); const qreal x0 = texteditObject->positionToRectangle(pos).x(); const qreal x1 = texteditObject->positionToRectangle(pos + 1).x(); @@ -1923,7 +1960,7 @@ void tst_qdeclarativetextedit::copyAndPaste() { if (status == noErr) CFRelease(pasteboard); else - QSKIP("This machine doesn't support the clipboard", SkipAll); + QSKIP("This machine doesn't support the clipboard"); } #endif @@ -2050,63 +2087,6 @@ QDeclarativeView *tst_qdeclarativetextedit::createView(const QString &filename) return canvas; } -class MyInputContext : public QInputContext -{ -public: - MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {} - ~MyInputContext() {} - - QString identifierName() { return QString(); } - QString language() { return QString(); } - - void reset() {} - - bool isComposing() const { return false; } - - bool filterEvent( const QEvent *event ) - { - if (event->type() == QEvent::RequestSoftwareInputPanel) - openInputPanelReceived = true; - if (event->type() == QEvent::CloseSoftwareInputPanel) - closeInputPanelReceived = true; - return QInputContext::filterEvent(event); - } - - void update() { updateReceived = true; } - - void sendPreeditText(const QString &text, int cursor) - { - QList<QInputMethodEvent::Attribute> attributes; - attributes.append(QInputMethodEvent::Attribute( - QInputMethodEvent::Cursor, cursor, text.length(), QVariant())); - - QInputMethodEvent event(text, attributes); - sendEvent(event); - } - - void mouseHandler(int x, QMouseEvent *event) - { - cursor = x; - eventType = event->type(); - eventPosition = event->pos(); - eventGlobalPosition = event->globalPos(); - eventButton = event->button(); - eventButtons = event->buttons(); - eventModifiers = event->modifiers(); - } - - bool openInputPanelReceived; - bool closeInputPanelReceived; - bool updateReceived; - int cursor; - QEvent::Type eventType; - QPoint eventPosition; - QPoint eventGlobalPosition; - Qt::MouseButton eventButton; - Qt::MouseButtons eventButtons; - Qt::KeyboardModifiers eventModifiers; -}; - void tst_qdeclarativetextedit::textInput() { QGraphicsScene scene; @@ -2136,10 +2116,12 @@ void tst_qdeclarativetextedit::textInput() void tst_qdeclarativetextedit::openInputPanelOnClick() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextEdit edit; QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool))); edit.setText("Hello world"); @@ -2162,14 +2144,14 @@ void tst_qdeclarativetextedit::openInputPanelOnClick() QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QApplication::processEvents(); if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) { - QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.isInputPanelVisible(), false); QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); + QCOMPARE(ic.isInputPanelVisible(), true); } else if (behavior == QStyle::RSIP_OnMouseClick) { - QCOMPARE(ic.openInputPanelReceived, true); + QCOMPARE(ic.isInputPanelVisible(), true); } - ic.openInputPanelReceived = false; + ic.clear(); // focus should not cause input panels to open or close edit.setFocus(false); @@ -2178,16 +2160,18 @@ void tst_qdeclarativetextedit::openInputPanelOnClick() edit.setFocus(true); edit.setFocus(false); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); } void tst_qdeclarativetextedit::openInputPanelOnFocus() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextEdit edit; QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool))); edit.setText("Hello world"); @@ -2205,27 +2189,27 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() // test default values QVERIFY(edit.focusOnPress()); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); // focus on press, input panel on focus QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QApplication::processEvents(); QVERIFY(edit.hasActiveFocus()); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); // no events on release QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); - QCOMPARE(ic.openInputPanelReceived, false); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), false); + ic.clear(); // if already focused, input panel can be opened on press QVERIFY(edit.hasActiveFocus()); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); // input method should stay enabled if focus // is lost to an item that also accepts inputs @@ -2233,9 +2217,8 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() scene.addItem(&anotherEdit); anotherEdit.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; - QCOMPARE(view.inputContext(), (QInputContext*)&ic); + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled)); // input method should be disabled if focus @@ -2244,8 +2227,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() scene.addItem(&item); item.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QVERIFY(view.inputContext() == 0); + QCOMPARE(ic.isInputPanelVisible(), false); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); // no automatic input panel events should @@ -2259,22 +2241,22 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); // one show input panel event should // be set when openSoftwareInputPanel is called edit.openSoftwareInputPanel(); - QCOMPARE(ic.openInputPanelReceived, true); - QCOMPARE(ic.closeInputPanelReceived, false); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); + ic.clear(); // one close input panel event should // be sent when closeSoftwareInputPanel is called edit.closeSoftwareInputPanel(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, true); - ic.closeInputPanelReceived = false; + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QVERIFY(ic.m_hideInputPanelCallCount > 0); + ic.clear(); // set activeFocusOnPress back to true edit.setFocusOnPress(true); @@ -2283,33 +2265,31 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() QCOMPARE(focusOnPressSpy.count(),2); edit.setFocus(false); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); - ic.closeInputPanelReceived = false; + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); + ic.clear(); // input panel should not re-open // if focus has already been set edit.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); edit.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.isInputPanelVisible(), false); // input method should be disabled // if TextEdit loses focus edit.setFocus(false); QApplication::processEvents(); - QVERIFY(view.inputContext() == 0); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); // input method should not be enabled // if TextEdit is read only. edit.setReadOnly(true); - ic.openInputPanelReceived = false; + ic.clear(); edit.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QVERIFY(view.inputContext() == 0); + QCOMPARE(ic.isInputPanelVisible(), false); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); } @@ -2466,12 +2446,12 @@ void tst_qdeclarativetextedit::testQtQuick11Attributes_data() void tst_qdeclarativetextedit::preeditMicroFocus() { - QString preeditText = "super"; + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextEdit edit; edit.setFocus(true); scene.addItem(&edit); @@ -2485,26 +2465,28 @@ void tst_qdeclarativetextedit::preeditMicroFocus() QRect currentRect; QRect previousRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); + QString preeditText = "super"; + // Verify that the micro focus rect is positioned the same for position 0 as // it would be if there was no preedit text. - ic.updateReceived = false; - ic.sendPreeditText(preeditText, 0); + ic.clear(); + sendPreeditText(preeditText, 0); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); -#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed. +#if defined(Q_WS_X11) || defined(Q_WS_QWS) + QCOMPARE(ic.updateCallCount, 0); // The cursor position hasn't changed. #endif QCOMPARE(cursorRectangleSpy.count(), 0); // Verify that the micro focus rect moves to the left as the cursor position // is incremented. for (int i = 1; i <= 5; ++i) { - ic.updateReceived = false; - ic.sendPreeditText(preeditText, i); + ic.clear(); + sendPreeditText(preeditText, i); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QVERIFY(previousRect.left() < currentRect.left()); -#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) + QVERIFY(ic.updateCallCount > 0); #endif QVERIFY(cursorRectangleSpy.count() > 0); cursorRectangleSpy.clear(); @@ -2513,25 +2495,28 @@ void tst_qdeclarativetextedit::preeditMicroFocus() // Verify that if there is no preedit cursor then the micro focus rect is the // same as it would be if it were positioned at the end of the preedit text. - ic.sendPreeditText(preeditText, 0); - ic.updateReceived = false; - ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>())); + sendPreeditText(preeditText, 0); + ic.clear(); + QInputMethodEvent imEvent(preeditText, QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &imEvent); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); -#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) + QVERIFY(ic.updateCallCount > 0); #endif QVERIFY(cursorRectangleSpy.count() > 0); } void tst_qdeclarativetextedit::inputContextMouseHandler() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + QString text = "supercalifragisiticexpialidocious!"; QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextEdit edit; edit.setPos(0, 0); edit.setWidth(200); @@ -2550,98 +2535,17 @@ void tst_qdeclarativetextedit::inputContextMouseHandler() const qreal y = fm.height() / 2; QPoint position2 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 2)), y))); - QPoint position8 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 8)), y))); - QPoint position20 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 20)), y))); - QPoint position27 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 27)), y))); - QPoint globalPosition2 = view.viewport()->mapToGlobal(position2); - QPoint globalposition8 = view.viewport()->mapToGlobal(position8); - QPoint globalposition20 = view.viewport()->mapToGlobal(position20); - QPoint globalposition27 = view.viewport()->mapToGlobal(position27); - - ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>())); - - QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; - QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonPress); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::None); - - { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::MouseMove); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one. - ic.eventType = QEvent::None; - - QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonRelease); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - // And in the other direction. - QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonPress); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::MouseMove); - QCOMPARE(ic.eventPosition, position20); - QCOMPARE(ic.eventGlobalPosition, globalposition20); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 7 && ic.cursor <= 9); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::None); + QInputMethodEvent inputEvent(text.mid(0, 12), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(&view, &inputEvent); + QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonRelease); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; + QApplication::processEvents(); + + QCOMPARE(ic.m_action, QInputPanel::Click); + QCOMPARE(ic.m_invokeActionCallCount, 1); + QCOMPARE(ic.m_cursorPosition, 2); } void tst_qdeclarativetextedit::inputMethodComposing() @@ -2650,8 +2554,6 @@ void tst_qdeclarativetextedit::inputMethodComposing() QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextEdit edit; edit.setWidth(200); edit.setText(text.mid(0, 12)); @@ -2668,15 +2570,24 @@ void tst_qdeclarativetextedit::inputMethodComposing() QCOMPARE(edit.isInputMethodComposing(), false); - ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>())); + { + QInputMethodEvent imEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(&view, &imEvent); + } QCOMPARE(edit.isInputMethodComposing(), true); QCOMPARE(spy.count(), 1); - ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>())); + { + QInputMethodEvent imEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(&view, &imEvent); + } QCOMPARE(edit.isInputMethodComposing(), true); QCOMPARE(spy.count(), 1); - ic.sendEvent(QInputMethodEvent()); + { + QInputMethodEvent imEvent; + QApplication::sendEvent(&view, &imEvent); + } QCOMPARE(edit.isInputMethodComposing(), false); QCOMPARE(spy.count(), 2); } diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro index 0fee1c93..c375cccb 100644 --- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro +++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativetextinput + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui gui-private widgets widgets-private core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetextinput.cpp diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index df598bea..ee81e4c8 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -40,10 +40,9 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include "../../../shared/util.h" -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeengine.h> #include <QFile> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativetextinput_p.h> #include <private/qdeclarativetextinput_p_p.h> #include <QDebug> @@ -51,6 +50,9 @@ #include <QStyle> #include <QInputContext> #include <private/qapplication_p.h> +#include <private/qinputpanel_p.h> +#include <private/qlinecontrol_p.h> +#include "../shared/platforminputcontext.h" #include "qplatformdefs.h" @@ -77,6 +79,16 @@ QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& return expectfile; } +void sendPreeditText(const QString &text, int cursor) +{ + QList<QInputMethodEvent::Attribute> attributes; + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursor, + text.length(), QVariant())); + QInputMethodEvent event(text, attributes); + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &event); +} + + class tst_qdeclarativetextinput : public QObject { @@ -2143,69 +2155,15 @@ QDeclarativeView *tst_qdeclarativetextinput::createView(const QString &filename) return canvas; } -class MyInputContext : public QInputContext -{ -public: - MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {} - ~MyInputContext() {} - - QString identifierName() { return QString(); } - QString language() { return QString(); } - - void reset() {} - - bool isComposing() const { return false; } - - bool filterEvent( const QEvent *event ) - { - if (event->type() == QEvent::RequestSoftwareInputPanel) - openInputPanelReceived = true; - if (event->type() == QEvent::CloseSoftwareInputPanel) - closeInputPanelReceived = true; - return QInputContext::filterEvent(event); - } - - void update() { updateReceived = true; } - - void mouseHandler(int x, QMouseEvent *event) - { - cursor = x; - eventType = event->type(); - eventPosition = event->pos(); - eventGlobalPosition = event->globalPos(); - eventButton = event->button(); - eventButtons = event->buttons(); - eventModifiers = event->modifiers(); - } - - void sendPreeditText(const QString &text, int cursor) - { - QList<QInputMethodEvent::Attribute> attributes; - attributes.append(QInputMethodEvent::Attribute( - QInputMethodEvent::Cursor, cursor, text.length(), QVariant())); - - QInputMethodEvent event(text, attributes); - sendEvent(event); - } - - bool openInputPanelReceived; - bool closeInputPanelReceived; - bool updateReceived; - int cursor; - QEvent::Type eventType; - QPoint eventPosition; - QPoint eventGlobalPosition; - Qt::MouseButton eventButton; - Qt::MouseButtons eventButtons; - Qt::KeyboardModifiers eventModifiers; -}; void tst_qdeclarativetextinput::openInputPanelOnClick() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool))); input.setText("Hello world"); @@ -2228,14 +2186,16 @@ void tst_qdeclarativetextinput::openInputPanelOnClick() QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QApplication::processEvents(); if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) { - QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.isInputPanelVisible(), false); QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); + QCOMPARE(ic.isInputPanelVisible(), true); } else if (behavior == QStyle::RSIP_OnMouseClick) { - QCOMPARE(ic.openInputPanelReceived, true); + QCOMPARE(ic.isInputPanelVisible(), true); } - ic.openInputPanelReceived = false; + + ic.m_showInputPanelCallCount = 0; + ic.m_hideInputPanelCallCount = 0; // focus should not cause input panels to open or close input.setFocus(false); @@ -2243,16 +2203,20 @@ void tst_qdeclarativetextinput::openInputPanelOnClick() input.setFocus(false); input.setFocus(true); input.setFocus(false); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); } void tst_qdeclarativetextinput::openInputPanelOnFocus() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + + ic.clear(); + QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool))); input.setText("Hello world"); @@ -2270,27 +2234,27 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() // test default values QVERIFY(input.focusOnPress()); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); // focus on press, input panel on focus QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QApplication::processEvents(); QVERIFY(input.hasActiveFocus()); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); // no events on release QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); - QCOMPARE(ic.openInputPanelReceived, false); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), false); + ic.clear(); // if already focused, input panel can be opened on press QVERIFY(input.hasActiveFocus()); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); // input method should stay enabled if focus // is lost to an item that also accepts inputs @@ -2298,9 +2262,8 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() scene.addItem(&anotherInput); anotherInput.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; - QCOMPARE(view.inputContext(), (QInputContext*)&ic); + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled)); // input method should be disabled if focus @@ -2309,9 +2272,9 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() scene.addItem(&item); item.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QVERIFY(view.inputContext() == 0); + QCOMPARE(ic.isInputPanelVisible(), false); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); + ic.clear(); // no automatic input panel events should // be sent if activeFocusOnPress is false @@ -2324,22 +2287,22 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos())); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); // one show input panel event should // be set when openSoftwareInputPanel is called input.openSoftwareInputPanel(); - QCOMPARE(ic.openInputPanelReceived, true); - QCOMPARE(ic.closeInputPanelReceived, false); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); + ic.clear(); // one close input panel event should // be sent when closeSoftwareInputPanel is called input.closeSoftwareInputPanel(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, true); - ic.closeInputPanelReceived = false; + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QVERIFY(ic.m_hideInputPanelCallCount > 0); + ic.clear(); // set activeFocusOnPress back to true input.setFocusOnPress(true); @@ -2348,17 +2311,17 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() QCOMPARE(focusOnPressSpy.count(),2); input.setFocus(false); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); - QCOMPARE(ic.closeInputPanelReceived, false); - ic.closeInputPanelReceived = false; + QCOMPARE(ic.m_showInputPanelCallCount, 0); + QCOMPARE(ic.m_hideInputPanelCallCount, 0); + ic.clear(); // input panel should not re-open // if focus has already been set input.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, true); - ic.openInputPanelReceived = false; + QCOMPARE(ic.isInputPanelVisible(), true); + ic.clear(); input.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.isInputPanelVisible(), false); // input method should be disabled // if TextInput loses focus @@ -2370,10 +2333,10 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() // input method should not be enabled // if TextInput is read only. input.setReadOnly(true); - ic.openInputPanelReceived = false; + ic.clear(); input.setFocus(true); QApplication::processEvents(); - QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.isInputPanelVisible(), false); QVERIFY(view.inputContext() == 0); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); } @@ -2492,8 +2455,6 @@ void tst_qdeclarativetextinput::preeditAutoScroll() QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; QFontMetricsF fm(input.font()); input.setWidth(fm.width(committedText)); @@ -2510,13 +2471,14 @@ void tst_qdeclarativetextinput::preeditAutoScroll() int cursorRectangleChanges = 0; // test the text is scrolled so the preedit is visible. - ic.sendPreeditText(preeditText.mid(0, 3), 1); + sendPreeditText(preeditText.mid(0, 3), 1); QVERIFY(input.positionAt(0) != 0); QVERIFY(input.cursorRectangle().left() < input.boundingRect().width()); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); // test the text is scrolled back when the preedit is removed. - ic.sendEvent(QInputMethodEvent()); + QInputMethodEvent emptyEvent; + QApplication::sendEvent(&view, &emptyEvent); QCOMPARE(input.positionAt(0), 0); QCOMPARE(input.positionAt(input.width()), 5); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); @@ -2532,14 +2494,14 @@ void tst_qdeclarativetextinput::preeditAutoScroll() // character preceding the cursor is still visible. qreal x = input.positionToRectangle(0).x(); for (int i = 0; i < 3; ++i) { - ic.sendPreeditText(preeditText, i + 1); + sendPreeditText(preeditText, i + 1); QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error); QVERIFY(input.positionToRectangle(0).x() < x); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); x = input.positionToRectangle(0).x(); } for (int i = 1; i >= 0; --i) { - ic.sendPreeditText(preeditText, i + 1); + sendPreeditText(preeditText, i + 1); QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error); QVERIFY(input.positionToRectangle(0).x() > x); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); @@ -2548,38 +2510,38 @@ void tst_qdeclarativetextinput::preeditAutoScroll() // Test incrementing the preedit cursor doesn't cause further // scrolling when right most text is visible. - ic.sendPreeditText(preeditText, preeditText.length() - 3); + sendPreeditText(preeditText, preeditText.length() - 3); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); x = input.positionToRectangle(0).x(); for (int i = 2; i >= 0; --i) { - ic.sendPreeditText(preeditText, preeditText.length() - i); + sendPreeditText(preeditText, preeditText.length() - i); QCOMPARE(input.positionToRectangle(0).x(), x); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); } for (int i = 1; i < 3; ++i) { - ic.sendPreeditText(preeditText, preeditText.length() - i); + sendPreeditText(preeditText, preeditText.length() - i); QCOMPARE(input.positionToRectangle(0).x(), x); QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); } // Test disabling auto scroll. - ic.sendEvent(QInputMethodEvent()); + QApplication::sendEvent(&view, &emptyEvent); input.setAutoScroll(false); - ic.sendPreeditText(preeditText.mid(0, 3), 1); + sendPreeditText(preeditText.mid(0, 3), 1); QCOMPARE(input.positionAt(0), 0); QCOMPARE(input.positionAt(input.width()), 5); - ic.sendEvent(QInputMethodEvent()); + QApplication::sendEvent(&view, &emptyEvent); input.setAutoScroll(true); // Test committing pre-edit text at the start of the string. QTBUG-18789 input.setCursorPosition(0); - ic.sendPreeditText(input.text(), 5); + sendPreeditText(input.text(), 5); QCOMPARE(input.positionAt(0), 0); QInputMethodEvent event; event.setCommitString(input.text()); - ic.sendEvent(event); + QApplication::sendEvent(&view, &emptyEvent); QCOMPARE(input.positionAt(0), 0); QCOMPARE(input.positionAt(input.width()), 5); @@ -2587,12 +2549,14 @@ void tst_qdeclarativetextinput::preeditAutoScroll() void tst_qdeclarativetextinput::preeditMicroFocus() { + PlatformInputContext ic; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = ⁣ + QString preeditText = "super"; QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; input.setPos(0, 0); input.setAutoScroll(false); @@ -2608,47 +2572,49 @@ void tst_qdeclarativetextinput::preeditMicroFocus() // Verify that the micro focus rect is positioned the same for position 0 as // it would be if there was no preedit text. - ic.updateReceived = false; - ic.sendPreeditText(preeditText, 0); + ic.clear(); + sendPreeditText(preeditText, 0); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); + QVERIFY(ic.updateCallCount > 0); #endif // Verify that the micro focus rect moves to the left as the cursor position // is incremented. for (int i = 1; i <= 5; ++i) { - ic.updateReceived = false; - ic.sendPreeditText(preeditText, i); + ic.clear(); + sendPreeditText(preeditText, i); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QVERIFY(previousRect.left() < currentRect.left()); #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); + QVERIFY(ic.updateCallCount > 0); #endif previousRect = currentRect; } // Verify that if there is no preedit cursor then the micro focus rect is the // same as it would be if it were positioned at the end of the preedit text. - ic.sendPreeditText(preeditText, 0); - ic.updateReceived = false; - ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>())); + sendPreeditText(preeditText, 0); + ic.clear(); + QInputMethodEvent imEvent(preeditText, QList<QInputMethodEvent::Attribute>()); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); + QVERIFY(ic.updateCallCount > 0); #endif } void tst_qdeclarativetextinput::inputContextMouseHandler() { + PlatformInputContext platformInputContext; + QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel()); + inputPanelPrivate->testContext = &platformInputContext; + QString text = "supercalifragisiticexpialidocious!"; QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; input.setWidth(200); input.setText(text.mid(0, 12)); @@ -2665,98 +2631,17 @@ void tst_qdeclarativetextinput::inputContextMouseHandler() const qreal y = fm.height() / 2; QPoint position2 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 2)), y))); - QPoint position8 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 8)), y))); - QPoint position20 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 20)), y))); - QPoint position27 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 27)), y))); - QPoint globalPosition2 = view.viewport()->mapToGlobal(position2); - QPoint globalposition8 = view.viewport()->mapToGlobal(position8); - QPoint globalposition20 = view.viewport()->mapToGlobal(position20); - QPoint globalposition27 = view.viewport()->mapToGlobal(position27); - - ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>())); - - QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; + + QInputMethodEvent inputEvent(text.mid(0, 5), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(&view, &inputEvent); QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonPress); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::None); - - { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::MouseMove); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one. - ic.eventType = QEvent::None; - - QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonRelease); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::NoModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - // And in the other direction. - QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::LeftButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27); - QCOMPARE(ic.eventType, QEvent::MouseButtonPress); - QCOMPARE(ic.eventPosition, position27); - QCOMPARE(ic.eventGlobalPosition, globalposition27); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::MouseMove); - QCOMPARE(ic.eventPosition, position20); - QCOMPARE(ic.eventGlobalPosition, globalposition20); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor >= 7 && ic.cursor <= 9); - ic.eventType = QEvent::None; - - { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier); - QApplication::sendEvent(view.viewport(), &mv); } - QCOMPARE(ic.eventType, QEvent::None); - - QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2); - QCOMPARE(ic.eventType, QEvent::MouseButtonRelease); - QCOMPARE(ic.eventPosition, position2); - QCOMPARE(ic.eventGlobalPosition, globalPosition2); - QCOMPARE(ic.eventButton, Qt::RightButton); - QCOMPARE(ic.eventModifiers, Qt::ControlModifier); - QVERIFY(ic.cursor < 0); - ic.eventType = QEvent::None; + QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2); + QApplication::processEvents(); + + QCOMPARE(platformInputContext.m_action, QInputPanel::Click); + QCOMPARE(platformInputContext.m_invokeActionCallCount, 1); + QCOMPARE(platformInputContext.m_cursorPosition, 2); } void tst_qdeclarativetextinput::inputMethodComposing() @@ -2765,8 +2650,6 @@ void tst_qdeclarativetextinput::inputMethodComposing() QGraphicsScene scene; QGraphicsView view(&scene); - MyInputContext ic; - view.setInputContext(&ic); QDeclarativeTextInput input; input.setWidth(200); input.setText(text.mid(0, 12)); @@ -2783,15 +2666,26 @@ void tst_qdeclarativetextinput::inputMethodComposing() QCOMPARE(input.isInputMethodComposing(), false); - ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>())); + { + QInputMethodEvent inputEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + } + QCOMPARE(input.isInputMethodComposing(), true); QCOMPARE(spy.count(), 1); - ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>())); + { + QInputMethodEvent inputEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()); + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + } + QCOMPARE(input.isInputMethodComposing(), true); QCOMPARE(spy.count(), 1); - ic.sendEvent(QInputMethodEvent()); + { + QInputMethodEvent inputEvent; + QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + } QCOMPARE(input.isInputMethodComposing(), false); QCOMPARE(spy.count(), 2); } diff --git a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro index 5a9e7f7a..0d4e164d 100644 --- a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro +++ b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativetimer + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetimer.cpp diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp index 15d6319b..79c14dbf 100644 --- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp +++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp @@ -40,10 +40,10 @@ ****************************************************************************/ #include <QtTest/QSignalSpy> #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativetimer_p.h> -#include <QtDeclarative/qdeclarativeitem.h> +#include <QtQuick1/qdeclarativeitem.h> #include <QDebug> #ifdef Q_OS_SYMBIAN diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro index 59b35268..f2193bc9 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro +++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qdeclarativevaluetypes + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private core-private script-private macx:CONFIG -= app_bundle HEADERS += testtypes.h diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro index fc4790d2..e5b64c61 100644 --- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro +++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeview + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 gui widgets macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeview.cpp diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp index 1a2fba24..785050c2 100644 --- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp +++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp @@ -40,12 +40,11 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativeitem.h> -#include <QtGui/qgraphicswidget.h> -#include "../../../shared/util.h" +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeitem.h> +#include <QtWidgets/qgraphicswidget.h> #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro index 8d4b4105..a059fa39 100644 --- a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro +++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativeviewer + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 gui macx:CONFIG -= app_bundle include(../../../../tools/qml/qml.pri) diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp index 6a38ac8d..fb2cddce 100644 --- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp +++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp @@ -40,16 +40,14 @@ ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeview.h> -#include <QtDeclarative/qdeclarativeitem.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtGui/qmenubar.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeitem.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtWidgets/qmenubar.h> #include <QSignalSpy> -#include "../../../shared/util.h" #include "qmlruntime.h" #include "deviceorientation.h" -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -114,8 +112,10 @@ void tst_QDeclarativeViewer::runtimeContextProperty() viewer->show(); QApplication::setActiveWindow(viewer); + //viewer->requestActivateWindow(); QTest::qWaitForWindowShown(viewer); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer)); + //QTRY_VERIFY(viewer == qGuiApp->focusWindow()); QVERIFY(runtimeObject->property("isActiveWindow").toBool()); diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro index fe3d7946..349d7502 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui +CONFIG += testcase +TARGET = tst_qdeclarativevisualdatamodel + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private gui widgets core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativevisualdatamodel.cpp diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index 28de5bd2..7bf2cbd2 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -38,15 +38,14 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "../../../shared/util.h" #include <qtest.h> #include <QtTest/QSignalSpy> #include <QStandardItemModel> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativeview.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativecontext.h> +#include <QtQuick1/qdeclarativeexpression.h> +#include <QtQuick1/qdeclarativeview.h> #include <private/qdeclarativelistview_p.h> #include <private/qdeclarativetext_p.h> #include <private/qdeclarativevisualitemmodel_p.h> @@ -215,6 +214,7 @@ void tst_qdeclarativevisualdatamodel::updateLayout() view.rootContext()->setContextProperty("myModel", &model); view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml")); + qDebug() << "setSource"; QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject()); QVERIFY(listview != 0); diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro index e20c3e6a..f86dcb02 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro +++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script +CONFIG += testcase +TARGET = tst_qdeclarativeworkerscript + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script core-private script-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeworkerscript.cpp diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp index 0fbdd0ab..6ead2c48 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp +++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp @@ -45,13 +45,12 @@ #include <QtCore/qfileinfo.h> #include <QtScript/qscriptengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeitem.h> +#include <QtQuick1/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeitem.h> #include <private/qdeclarativeworkerscript_p.h> #include <private/qdeclarativeengine_p.h> -#include "../../../shared/util.h" Q_DECLARE_METATYPE(QScriptValue) diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro index 4b5bf6eb..0c1347e2 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative network +CONFIG += testcase +TARGET = tst_qdeclarativexmlhttprequest + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 network macx:CONFIG -= app_bundle INCLUDEPATH += ../shared/ diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp index 879910dc..3fbda081 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp @@ -45,7 +45,6 @@ #include <QDebug> #include <QNetworkCookieJar> #include "testhttpserver.h" -#include "../../../shared/util.h" #define SERVER_PORT 14445 diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro index 64b82677..a3dfd649 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro +++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script gui network +CONFIG += testcase +TARGET = tst_qdeclarativexmllistmodel + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private script gui network core-private script-private contains(QT_CONFIG,xmlpatterns) { QT += xmlpatterns DEFINES += QTEST_XMLPATTERNS diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index 6a7ae44a..d59b38e4 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -46,7 +46,7 @@ #include <qtest.h> #include <QtTest/qsignalspy.h> -#include <QtDeclarative/qdeclarativenetworkaccessmanagerfactory.h> +#include <QtQuick1/qdeclarativenetworkaccessmanagerfactory.h> #include <QtNetwork/qnetworkaccessmanager.h> #include <QtNetwork/qnetworkrequest.h> #include <QtCore/qtimer.h> @@ -54,10 +54,9 @@ #include <QtCore/qtemporaryfile.h> #ifdef QTEST_XMLPATTERNS -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQuick1/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativecomponent.h> #include <private/qdeclarativexmllistmodel_p.h> -#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir diff --git a/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro b/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro index 988177e5..736fe66b 100644 --- a/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro +++ b/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qmetaobjectbuilder + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 quick1-private macx:CONFIG -= app_bundle SOURCES += \ diff --git a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro index aa0e07a0..fdd2d784 100644 --- a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro +++ b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -1,6 +1,8 @@ -load(qttest_p4) +CONFIG += testcase +TARGET = tst_qmlshadersplugin -QT += opengl declarative +QT += testlib +QT += opengl quick1 gui widgets SOURCES += tst_qmlshadersplugin.cpp SOURCES += \ diff --git a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp index ba7f7957..6c8d2f17 100644 --- a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp +++ b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative> +#include <QtQuick1> #include "../../../../src/imports/shaders/shadereffectitem.h" #include "../../../../src/imports/shaders/shadereffectsource.h" #include "../../../../src/imports/shaders/shadereffect.h" diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro index 36d2600d..319f1b56 100644 --- a/tests/auto/declarative/qmlvisual/qmlvisual.pro +++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qmlvisual + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 gui widgets macx:CONFIG -= app_bundle SOURCES += tst_qmlvisual.cpp diff --git a/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro index 7ffda931..263598a6 100644 --- a/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro +++ b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += network declarative +CONFIG += testcase +TARGET = tst_qpacketprotocol + +QT += testlib +contains(QT_CONFIG,quick1): QT += network quick1 quick1-private core-private gui-private widgets-private macx:CONFIG -= app_bundle HEADERS += ../shared/debugutil_p.h diff --git a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro index 656bf686..beb8a8e7 100644 --- a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro +++ b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro @@ -1,5 +1,8 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative +CONFIG += testcase +TARGET = tst_qperformancetimer + +QT += testlib +contains(QT_CONFIG,quick1): QT += quick1 SOURCES += tst_qperformancetimer.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h index 61e49286..4ce95896 100644 --- a/tests/auto/declarative/shared/debugutil_p.h +++ b/tests/auto/declarative/shared/debugutil_p.h @@ -45,7 +45,7 @@ #include <QThread> #include <QTest> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQuick1/qdeclarativeengine.h> #include <private/qdeclarativedebugclient_p.h> #include <private/qdeclarativedebugservice_p.h> diff --git a/tests/auto/declarative/shared/platforminputcontext.h b/tests/auto/declarative/shared/platforminputcontext.h new file mode 100644 index 00000000..0c23db4d --- /dev/null +++ b/tests/auto/declarative/shared/platforminputcontext.h @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qplatforminputcontext_qpa.h> +#include <QtGui/QInputPanel> + +class PlatformInputContext : public QPlatformInputContext +{ +public: + PlatformInputContext() + : m_visible(false), m_action(QInputPanel::Click), m_cursorPosition(0), + m_invokeActionCallCount(0), m_showInputPanelCallCount(0), m_hideInputPanelCallCount(0), + m_updateCallCount(0), m_direction(Qt::LeftToRight) + { + } + + virtual void showInputPanel() + { + m_visible = true; + m_showInputPanelCallCount++; + } + virtual void hideInputPanel() + { + m_visible = false; + m_hideInputPanelCallCount++; + } + virtual bool isInputPanelVisible() const + { + return m_visible; + } + virtual void invokeAction(QInputPanel::Action action, int cursorPosition) + { + m_invokeActionCallCount++; + m_action = action; + m_cursorPosition = cursorPosition; + } + virtual void update(Qt::InputMethodQueries) + { + m_updateCallCount++; + } + + virtual QLocale locale() const + { + if (m_direction == Qt::RightToLeft) + return QLocale(QLocale::Arabic); + else + return QLocale(QLocale::English); + } + + virtual Qt::LayoutDirection inputDirection() const + { + return m_direction; + } + + void setInputDirection(Qt::LayoutDirection direction) { + m_direction = direction; + emitLocaleChanged(); + emitInputDirectionChanged(inputDirection()); + } + + void clear() { + m_cursorPosition = 0; + m_invokeActionCallCount = 0; + m_visible = false; + m_showInputPanelCallCount = 0; + m_hideInputPanelCallCount = 0; + m_updateCallCount = 0; + } + + bool m_visible; + QInputPanel::Action m_action; + int m_cursorPosition; + int m_invokeActionCallCount; + int m_showInputPanelCallCount; + int m_hideInputPanelCallCount; + int m_updateCallCount; + Qt::LayoutDirection m_direction; +}; |