diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-22 09:05:17 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-22 09:05:17 (GMT) |
commit | 26139fcacc05b4a74fce1ef4e0db819118765310 (patch) | |
tree | 75ce453868e95faa72b8f3b871c58969bbeb2a7e /tests | |
parent | 9a216c3f7abeacae8b9e9f78e50ddfcfbb5e2fa3 (diff) | |
parent | b8238ec7e41d483a9166eb7aebbf911f36976cdc (diff) | |
download | Qt-26139fcacc05b4a74fce1ef4e0db819118765310.zip Qt-26139fcacc05b4a74fce1ef4e0db819118765310.tar.gz Qt-26139fcacc05b4a74fce1ef4e0db819118765310.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Conflicts:
src/gui/kernel/qapplication_win.cpp
src/gui/kernel/qwidget.cpp
src/gui/text/qfontengine_ft.cpp
Diffstat (limited to 'tests')
255 files changed, 1996 insertions, 303 deletions
diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro index 3692f21..56b7f25 100644 --- a/tests/arthur/lance/lance.pro +++ b/tests/arthur/lance/lance.pro @@ -13,7 +13,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, o contains(QT_CONFIG, qt3support):QT += qt3support symbian*: { - testData.sources = $$QT_BUILD_TREE/tests/arthur/data/qps + testData.files = $$QT_BUILD_TREE/tests/arthur/data/qps testData.path = . DEPLOYMENT += testData } diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro index 319ba9b..ab932f5 100644 --- a/tests/auto/checkxmlfiles/checkxmlfiles.pro +++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro @@ -8,7 +8,7 @@ include (../xmlpatterns.pri) wince*|symbian: { QT += network -addFiles.sources = \ +addFiles.files = \ $$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \ $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/globals.gccxml \ $$QT_SOURCE_TREE/doc/src/diagrams/stylesheet/treeview.svg \ diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index 2e243b4..8ed33da 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -7,7 +7,7 @@ SOURCES += tst_examples.cpp include(../../../../tools/qml/qml.pri) symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro index 4ee634e..808f263 100644 --- a/tests/auto/declarative/moduleqt47/moduleqt47.pro +++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_moduleqt47.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro index bb1d69f..1e323f7 100644 --- a/tests/auto/declarative/parserstress/parserstress.pro +++ b/tests/auto/declarative/parserstress/parserstress.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_parserstress.cpp symbian: { - importFiles.sources = ..\\..\\qscriptjstestsuite\\tests + importFiles.files = ..\\..\\qscriptjstestsuite\\tests importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro index 9798bb6..141e25d 100644 --- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro +++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeanchors.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro index 0a2f0f2..ad9509a 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro +++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro @@ -5,7 +5,7 @@ SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro index ed47dca..84cd498 100644 --- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro +++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeanimations.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml index 9fca5c3..56ac216 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml @@ -7,9 +7,9 @@ Rectangle { objectName: "MyRect" width: 100; height: 100; color: "green" Behavior on x { + id: myBehavior objectName: "MyBehavior" NumberAnimation {id: na1; duration: 200 } - NumberAnimation {id: na2; duration: 1000 } } } MouseArea { @@ -24,4 +24,9 @@ Rectangle { x: 200 } } + + NumberAnimation {id: na2; duration: 1000 } + Component.onCompleted: { + myBehavior.animation = na2; + } } diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro index cfb59ef..e4125fd 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro +++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativebehaviors.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro index a7ba2a8..25bdbec 100644 --- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro +++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativebinding.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro index a21761b..05d4cac 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro +++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro index d06ce4f..c614571 100644 --- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro +++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeconnection.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro index 415d4e2..e8f24a5 100644 --- a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro +++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativedom.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml new file mode 100644 index 0000000..ca8c90d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +QtObject { + objectName: "hello" + + property string test1: objectName + property string test2: objectName.substr(1, 3) +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro index 58cad34..e7f8636 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro +++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro @@ -13,7 +13,7 @@ INCLUDEPATH += ../shared # LIBS += -lgcov symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 4feb630..02832f3 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -162,6 +162,7 @@ private slots: void deleteLater(); void in(); void sharedAttachedObject(); + void objectName(); void include(); @@ -2594,6 +2595,24 @@ void tst_qdeclarativeecmascript::sharedAttachedObject() delete o; } +// QTBUG-13999 +void tst_qdeclarativeecmascript::objectName() +{ + QDeclarativeComponent component(&engine, TEST_FILE("objectName.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toString(), QString("hello")); + QCOMPARE(o->property("test2").toString(), QString("ell")); + + o->setObjectName("world"); + + QCOMPARE(o->property("test1").toString(), QString("world")); + QCOMPARE(o->property("test2").toString(), QString("orl")); + + delete o; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro index be0ba6c..1fb99d0 100644 --- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro +++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflickable.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro index 759e80b..eddd053 100644 --- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro +++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflipable.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml new file mode 100644 index 0000000..1784202 --- /dev/null +++ b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Rectangle { + width: 400; height: 400 + + property bool showRect: false + onShowRectChanged: if (showRect) rect.visible = true + property bool noFocus: !fs2.activeFocus + + FocusScope { + id: fs1 + focus: true + } + Rectangle { + id: rect + visible: false + FocusScope { + id: fs2 + Rectangle { + focus: true + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro index 24749c6..fd7f6b8 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro +++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativefocusscope.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp index ec8f048..4cafbd9 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp +++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp @@ -70,6 +70,7 @@ private slots: void forceFocus(); void noParentFocus(); void signalEmission(); + void qtBug13380(); }; /* @@ -400,6 +401,31 @@ void tst_qdeclarativefocusscope::signalEmission() delete view; } +void tst_qdeclarativefocusscope::qtBug13380() +{ + QDeclarativeView *view = new QDeclarativeView; + view->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtBug13380.qml")); + + view->show(); + QVERIFY(view->rootObject()); + qApp->setActiveWindow(view); + qApp->processEvents(); + +#ifdef Q_WS_X11 + // to be safe and avoid failing setFocus with window managers + qt_x11_wait_for_window_manager(view); +#endif + + QVERIFY(view->hasFocus()); + QVERIFY(view->scene()->hasFocus()); + QVERIFY(view->rootObject()->property("noFocus").toBool()); + + view->rootObject()->setProperty("showRect", true); + QVERIFY(view->rootObject()->property("noFocus").toBool()); + + delete view; +} + QTEST_MAIN(tst_qdeclarativefocusscope) #include "tst_qdeclarativefocusscope.moc" diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro index 91bf4a7..50c7ca0 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativefolderlistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro index 01dca26..f245a0d 100644 --- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro +++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativegridview/data/header.qml b/tests/auto/declarative/qdeclarativegridview/data/header.qml new file mode 100644 index 0000000..99baacd --- /dev/null +++ b/tests/auto/declarative/qdeclarativegridview/data/header.qml @@ -0,0 +1,32 @@ +import QtQuick 1.0 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + width: 80 + height: 60 + border.color: "blue" + Text { + text: index + } + color: GridView.isCurrentItem ? "lightsteelblue" : "white" + } + } + GridView { + id: grid + objectName: "grid" + width: 240 + height: 320 + cellWidth: 80 + cellHeight: 60 + model: testModel + delegate: myDelegate + header: Text { objectName: "header"; text: "Header"; height: 30 } + } +} diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro index a99a1b9..b775b3d 100644 --- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro +++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativegridview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 975cf8f..f7acd87 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -82,6 +82,7 @@ private slots: void QTBUG_8456(); void manualHighlight(); void footer(); + void header(); private: QDeclarativeView *createView(); @@ -1214,6 +1215,40 @@ void tst_QDeclarativeGridView::footer() QTRY_COMPARE(footer->y(), 0.0); } +void tst_QDeclarativeGridView::header() +{ + QDeclarativeView *canvas = createView(); + + TestModel model; + for (int i = 0; i < 7; i++) + model.addItem("Item" + QString::number(i), ""); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml")); + qApp->processEvents(); + + QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid"); + QTRY_VERIFY(gridview != 0); + + QDeclarativeItem *contentItem = gridview->contentItem(); + QTRY_VERIFY(contentItem != 0); + + QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header"); + QVERIFY(header); + + QCOMPARE(header->y(), 0.0); + QCOMPARE(gridview->contentY(), 0.0); + + QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0); + QVERIFY(item); + QCOMPARE(item->y(), 30.0); + + model.clear(); + QTRY_COMPARE(header->y(), 0.0); +} + QDeclarativeView *tst_QDeclarativeGridView::createView() { diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro index 244a1e1..c87c1d9 100644 --- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro +++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 6fce2ad..f1e026f 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -83,6 +83,8 @@ private slots: void big(); void tiling_QTBUG_6716(); void noLoading(); + void paintedWidthHeight(); + void sourceSize_QTBUG_14303(); private: template<typename T> @@ -376,7 +378,7 @@ void tst_qdeclarativeimage::noLoading() QTRY_COMPARE(statusSpy.count(), 0); // Loading remote file - ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png"); QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); QTRY_VERIFY(obj->progress() == 0.0); QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); @@ -387,7 +389,7 @@ void tst_qdeclarativeimage::noLoading() // Loading remote file again - should not go through 'Loading' state. ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); - ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png"); QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 4); @@ -395,6 +397,75 @@ void tst_qdeclarativeimage::noLoading() QTRY_COMPARE(statusSpy.count(), 2); } +void tst_qdeclarativeimage::paintedWidthHeight() +{ + { + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString(); + QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 200; height: 25; fillMode: Image.PreserveAspectFit }"; + + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->pixmap().width(), 300); + QCOMPARE(obj->pixmap().height(), 300); + QCOMPARE(obj->width(), 200.0); + QCOMPARE(obj->height(), 25.0); + QCOMPARE(obj->paintedWidth(), 25.0); + QCOMPARE(obj->paintedHeight(), 25.0); + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png")); + + delete obj; + } + + { + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString(); + QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->pixmap().width(), 300); + QCOMPARE(obj->pixmap().height(), 300); + QCOMPARE(obj->width(), 26.0); + QCOMPARE(obj->height(), 175.0); + QCOMPARE(obj->paintedWidth(), 26.0); + QCOMPARE(obj->paintedHeight(), 26.0); + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png")); + + delete obj; + } +} + +void tst_qdeclarativeimage::sourceSize_QTBUG_14303() +{ + QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }"; + QDeclarativeContext *ctxt = engine.rootContext(); + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png")); + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create()); + + QSignalSpy sourceSizeSpy(obj, SIGNAL(sourceSizeChanged())); + + QTRY_VERIFY(obj != 0); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); + + QTRY_COMPARE(obj->sourceSize().width(), 200); + QTRY_COMPARE(obj->sourceSize().height(), 200); + QTRY_COMPARE(sourceSizeSpy.count(), 0); + + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); + QTRY_COMPARE(obj->sourceSize().width(), 120); + QTRY_COMPARE(obj->sourceSize().height(), 120); + QTRY_COMPARE(sourceSizeSpy.count(), 1); + + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png")); + QTRY_COMPARE(obj->sourceSize().width(), 200); + QTRY_COMPARE(obj->sourceSize().height(), 200); + QTRY_COMPARE(sourceSizeSpy.count(), 2); +} + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro index 2c20e7e..888596f 100644 --- a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro +++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeinfo.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml index aedccd9..9af6e9f 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml @@ -2,6 +2,9 @@ import QtQuick 1.0 Item { focus: true + + property bool isEnabled: Keys.enabled + Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; } Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers) @@ -14,6 +17,7 @@ Item { Item { id: item2 + visible: forwardeeVisible Keys.onPressed: keysTestObject.forwardedKey(event.key) Keys.onReleased: keysTestObject.forwardedKey(event.key) } diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro index f4901c4..0fd871e 100644 --- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro +++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeitem.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index e9dad6b..b4903ae 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -204,6 +204,7 @@ void tst_QDeclarativeItem::keys() canvas->rootContext()->setContextProperty("keysTestObject", testObject); canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true)); + canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(true)); canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keystest.qml")); canvas->show(); @@ -214,6 +215,9 @@ void tst_QDeclarativeItem::keys() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); + QVERIFY(canvas->rootObject()); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true); + QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1); QApplication::sendEvent(canvas, &key); QCOMPARE(testObject->mKey, int(Qt::Key_A)); @@ -284,7 +288,19 @@ void tst_QDeclarativeItem::keys() testObject->reset(); + canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(false)); + key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1); + QApplication::sendEvent(canvas, &key); + QCOMPARE(testObject->mKey, int(Qt::Key_A)); + QCOMPARE(testObject->mForwardedKey, 0); + QCOMPARE(testObject->mText, QLatin1String("A")); + QVERIFY(testObject->mModifiers == Qt::NoModifier); + QVERIFY(!key.isAccepted()); + + testObject->reset(); + canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false)); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false); key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1); QApplication::sendEvent(canvas, &key); @@ -292,6 +308,7 @@ void tst_QDeclarativeItem::keys() QVERIFY(!key.isAccepted()); canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true)); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true); key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1); QApplication::sendEvent(canvas, &key); diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml new file mode 100644 index 0000000..bf6352e --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias valueAlias: root.rectProperty + + rectProperty: "10,11,9x8" +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml new file mode 100644 index 0000000..fbd50d9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + id: root + + property alias aliasProperty: root.rectProperty.x + rectProperty: "19,13,100x120" +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml new file mode 100644 index 0000000..7944deb --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml @@ -0,0 +1,16 @@ +import QtQuick 1.0 + +QtObject { + id: root + + property alias aliasProperty: root.realProperty + onAliasPropertyChanged: root.test = true + + property int realProperty: 0 + + property bool test: false + + Component.onCompleted: { + root.realProperty = 10; + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml new file mode 100644 index 0000000..247f527 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml @@ -0,0 +1,5 @@ +import QtQuick 1.0 +import com.Nokia.installedtest 1.0 + +QtObject { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt new file mode 100644 index 0000000..3813680 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt @@ -0,0 +1,2 @@ +3:1:Type IncorrectCaseType unavailable +-1:-1:File name case mismatch diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt new file mode 100644 index 0000000..abed1a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt @@ -0,0 +1 @@ +3:1:IncorrectCaseType is not a type diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml new file mode 100644 index 0000000..d11000b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +IncorrectCaseType { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml new file mode 100644 index 0000000..cf32b45 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +QtObject { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml new file mode 100644 index 0000000..3ff7b16 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.rectProperty.blah +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt index 7260be4..fbf1b58 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt @@ -1 +1 @@ -5:23:Invalid alias reference. An alias reference must be specified as <id> or <id>.<property> +5:23:Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property> diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml index cc71753..a363373 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml @@ -2,5 +2,5 @@ import Test 1.0 MyTypeObject { id: root - property alias a: root.rectProperty.x + property alias a: root.rectProperty.x.y } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt index 7260be4..fbf1b58 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt @@ -1 +1 @@ -5:23:Invalid alias reference. An alias reference must be specified as <id> or <id>.<property> +5:23:Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property> diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml new file mode 100644 index 0000000..4faa52d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.imaginary.x +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml new file mode 100644 index 0000000..f183912 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.floatProperty.x +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt new file mode 100644 index 0000000..beae562 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt @@ -0,0 +1 @@ +5:10:Cannot assign multiple values to a singular property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml new file mode 100644 index 0000000..2fd7fd2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +QtObject { + property QtObject a + a: [ QtObject {}, QtObject {} ] +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt new file mode 100644 index 0000000..beae562 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt @@ -0,0 +1 @@ +5:10:Cannot assign multiple values to a singular property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml new file mode 100644 index 0000000..da56cb8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +QtObject { + property variant a + a: [ QtObject {}, QtObject {} ] +} diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro index 43c451f..aa69337 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro +++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro @@ -12,7 +12,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml new file mode 100644 index 0000000..0b054d0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 7f81fc0..061ac48 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -119,6 +119,7 @@ private slots: void cppnamespace(); void aliasProperties(); void aliasPropertiesAndSignals(); + void aliasPropertyChangeSignals(); void componentCompositeType(); void i18n(); void i18n_data(); @@ -128,6 +129,8 @@ private slots: void defaultPropertyListOrder(); void declaredPropertyValues(); void dontDoubleCallClassBegin(); + void reservedWords_data(); + void reservedWords(); void basicRemote_data(); void basicRemote(); @@ -141,6 +144,7 @@ private slots: void importsInstalled(); void importsOrder_data(); void importsOrder(); + void importIncorrectCase(); void qmlAttachedPropertiesObjectMethod(); void customOnProperty(); @@ -345,6 +349,9 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidAlias.5") << "invalidAlias.5.qml" << "invalidAlias.5.errors.txt" << false; QTest::newRow("invalidAlias.6") << "invalidAlias.6.qml" << "invalidAlias.6.errors.txt" << false; QTest::newRow("invalidAlias.7") << "invalidAlias.7.qml" << "invalidAlias.7.errors.txt" << false; + QTest::newRow("invalidAlias.8") << "invalidAlias.8.qml" << "invalidAlias.8.errors.txt" << false; + QTest::newRow("invalidAlias.9") << "invalidAlias.9.qml" << "invalidAlias.9.errors.txt" << false; + QTest::newRow("invalidAlias.10") << "invalidAlias.10.qml" << "invalidAlias.10.errors.txt" << false; QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; @@ -377,6 +384,15 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidProperty") << "invalidProperty.qml" << "invalidProperty.errors.txt" << false; QTest::newRow("nonScriptableProperty") << "nonScriptableProperty.qml" << "nonScriptableProperty.errors.txt" << false; QTest::newRow("notAvailable") << "notAvailable.qml" << "notAvailable.errors.txt" << false; + QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false; + QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false; + QTest::newRow("incorrectCase") << "incorrectCase.qml" +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) + << "incorrectCase.errors.insensitive.txt" +#else + << "incorrectCase.errors.sensitive.txt" +#endif + << false; } @@ -1051,6 +1067,47 @@ void tst_qdeclarativelanguage::aliasProperties() delete object; } + + // Valuetype alias + // Simple "int" alias + { + QDeclarativeComponent component(&engine, TEST_FILE("alias.10.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + QCOMPARE(object->property("valueAlias").toRect(), QRect(10, 11, 9, 8)); + object->setProperty("rectProperty", QVariant(QRect(33, 12, 99, 100))); + QCOMPARE(object->property("valueAlias").toRect(), QRect(33, 12, 99, 100)); + + // Write throught alias + object->setProperty("valueAlias", QVariant(QRect(3, 3, 4, 9))); + QCOMPARE(object->property("valueAlias").toRect(), QRect(3, 3, 4, 9)); + QCOMPARE(object->property("rectProperty").toRect(), QRect(3, 3, 4, 9)); + + delete object; + } + + // Valuetype sub-alias + { + QDeclarativeComponent component(&engine, TEST_FILE("alias.11.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + QCOMPARE(object->property("aliasProperty").toInt(), 19); + object->setProperty("rectProperty", QVariant(QRect(33, 8, 102, 111))); + QCOMPARE(object->property("aliasProperty").toInt(), 33); + + // Write throught alias + object->setProperty("aliasProperty", QVariant(4)); + QCOMPARE(object->property("aliasProperty").toInt(), 4); + QCOMPARE(object->property("rectProperty").toRect(), QRect(4, 8, 102, 111)); + + delete object; + } } // QTBUG-13374 Test that alias properties and signals can coexist @@ -1222,6 +1279,80 @@ void tst_qdeclarativelanguage::dontDoubleCallClassBegin() delete o; } +void tst_qdeclarativelanguage::reservedWords_data() +{ + QTest::addColumn<QByteArray>("word"); + + QTest::newRow("abstract") << QByteArray("abstract"); + QTest::newRow("as") << QByteArray("as"); + QTest::newRow("boolean") << QByteArray("boolean"); + QTest::newRow("break") << QByteArray("break"); + QTest::newRow("byte") << QByteArray("byte"); + QTest::newRow("case") << QByteArray("case"); + QTest::newRow("catch") << QByteArray("catch"); + QTest::newRow("char") << QByteArray("char"); + QTest::newRow("class") << QByteArray("class"); + QTest::newRow("continue") << QByteArray("continue"); + QTest::newRow("const") << QByteArray("const"); + QTest::newRow("debugger") << QByteArray("debugger"); + QTest::newRow("default") << QByteArray("default"); + QTest::newRow("delete") << QByteArray("delete"); + QTest::newRow("do") << QByteArray("do"); + QTest::newRow("double") << QByteArray("double"); + QTest::newRow("else") << QByteArray("else"); + QTest::newRow("enum") << QByteArray("enum"); + QTest::newRow("export") << QByteArray("export"); + QTest::newRow("extends") << QByteArray("extends"); + QTest::newRow("false") << QByteArray("false"); + QTest::newRow("final") << QByteArray("final"); + QTest::newRow("finally") << QByteArray("finally"); + QTest::newRow("float") << QByteArray("float"); + QTest::newRow("for") << QByteArray("for"); + QTest::newRow("function") << QByteArray("function"); + QTest::newRow("goto") << QByteArray("goto"); + QTest::newRow("if") << QByteArray("if"); + QTest::newRow("implements") << QByteArray("implements"); + QTest::newRow("import") << QByteArray("import"); + QTest::newRow("in") << QByteArray("in"); + QTest::newRow("instanceof") << QByteArray("instanceof"); + QTest::newRow("int") << QByteArray("int"); + QTest::newRow("interface") << QByteArray("interface"); + QTest::newRow("long") << QByteArray("long"); + QTest::newRow("native") << QByteArray("native"); + QTest::newRow("new") << QByteArray("new"); + QTest::newRow("null") << QByteArray("null"); + QTest::newRow("package") << QByteArray("package"); + QTest::newRow("private") << QByteArray("private"); + QTest::newRow("protected") << QByteArray("protected"); + QTest::newRow("public") << QByteArray("public"); + QTest::newRow("return") << QByteArray("return"); + QTest::newRow("short") << QByteArray("short"); + QTest::newRow("static") << QByteArray("static"); + QTest::newRow("super") << QByteArray("super"); + QTest::newRow("switch") << QByteArray("switch"); + QTest::newRow("synchronized") << QByteArray("synchronized"); + QTest::newRow("this") << QByteArray("this"); + QTest::newRow("throw") << QByteArray("throw"); + QTest::newRow("throws") << QByteArray("throws"); + QTest::newRow("transient") << QByteArray("transient"); + QTest::newRow("true") << QByteArray("true"); + QTest::newRow("try") << QByteArray("try"); + QTest::newRow("typeof") << QByteArray("typeof"); + QTest::newRow("var") << QByteArray("var"); + QTest::newRow("void") << QByteArray("void"); + QTest::newRow("volatile") << QByteArray("volatile"); + QTest::newRow("while") << QByteArray("while"); + QTest::newRow("with") << QByteArray("with"); +} + +void tst_qdeclarativelanguage::reservedWords() +{ + QFETCH(QByteArray, word); + QDeclarativeComponent component(&engine); + component.setData("import QtQuick 1.0\nQtObject { property string " + word + " }", QUrl()); + QCOMPARE(component.errorString(), QLatin1String(":2 Expected token `identifier'\n")); +} + // Check that first child of qml is of given type. Empty type insists on error. void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type, const QString& expectederror) { @@ -1438,6 +1569,7 @@ void tst_qdeclarativelanguage::basicRemote_data() QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage/"; QTest::newRow("no need for qmldir") << QUrl(serverdir+"Test.qml") << "" << ""; + QTest::newRow("absent qmldir") << QUrl(serverdir+"/noqmldir/Test.qml") << "" << ""; QTest::newRow("need qmldir") << QUrl(serverdir+"TestLocal.qml") << "" << ""; } @@ -1645,6 +1777,22 @@ void tst_qdeclarativelanguage::importsOrder() testType(qml,type,error); } +void tst_qdeclarativelanguage::importIncorrectCase() +{ + QDeclarativeComponent component(&engine, TEST_FILE("importIncorrectCase.qml")); + + QList<QDeclarativeError> errors = component.errors(); + QCOMPARE(errors.count(), 1); + +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) + QString expectedError = QLatin1String("cannot load module \"com.Nokia.installedtest\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("data/lib/com/Nokia/installedtest/qmldir") + QLatin1String("\""); +#else + QString expectedError = QLatin1String("module \"com.Nokia.installedtest\" is not installed"); +#endif + + QCOMPARE(errors.at(0).description(), expectedError); +} + void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod() { QObject object; @@ -1740,6 +1888,19 @@ void tst_qdeclarativelanguage::initTestCase() out.write(in.readAll()); } +void tst_qdeclarativelanguage::aliasPropertyChangeSignals() +{ + QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml")); + + VERIFY_ERRORS(0); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_qdeclarativelanguage) #include "tst_qdeclarativelanguage.moc" diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro index 5076e51..42d9a80 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro +++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelayoutitem.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp index bbdba74..cc0f633 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp +++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp @@ -82,6 +82,11 @@ void tst_qdeclarativelayoutitem::test_resizing() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/layoutItem.qml")); QDeclarativeLayoutItem* obj = static_cast<QDeclarativeLayoutItem*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->minimumSize(), QSizeF(100,100)); + QCOMPARE(obj->preferredSize(), QSizeF(200,200)); + QCOMPARE(obj->maximumSize(), QSizeF(300,300)); + layout->addItem(obj); layout->setContentsMargins(0,0,0,0); widget->setContentsMargins(0,0,0,0); diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro index e90db49..8a39555 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro +++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index be77f8e..4b8d772 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -320,11 +320,16 @@ void tst_qdeclarativelistmodel::dynamic() if (!warning.isEmpty()) QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); + QSignalSpy spyCount(&model, SIGNAL(countChanged())); + int actual = e.evaluate().toInt(); if (e.hasError()) qDebug() << e.error(); // errors not expected QCOMPARE(actual,result); + + if (model.count() > 0) + QVERIFY(spyCount.count() > 0); } void tst_qdeclarativelistmodel::dynamic_worker_data() @@ -351,6 +356,8 @@ void tst_qdeclarativelistmodel::dynamic_worker() QDeclarativeItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); + QSignalSpy spyCount(&model, SIGNAL(countChanged())); + if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}')) script = script.mid(1, script.length() - 2); QVariantList operations; @@ -367,6 +374,9 @@ void tst_qdeclarativelistmodel::dynamic_worker() waitForWorker(item); QCOMPARE(QDeclarativeProperty(item, "result").read().toInt(), result); + if (model.count() > 0) + QVERIFY(spyCount.count() > 0); + delete item; qApp->processEvents(); } diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro index 2c5a859..99eba67 100644 --- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro +++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelistview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index ec8ee82..2649c0d 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -937,6 +937,8 @@ void tst_QDeclarativeListView::sections() QCOMPARE(next->text().toInt(), (i+1)/5); } + QSignalSpy currentSectionChangedSpy(listview, SIGNAL(currentSectionChanged())); + // Remove section boundary model.removeItem(5); @@ -972,9 +974,13 @@ void tst_QDeclarativeListView::sections() listview->setContentY(140); QTRY_COMPARE(listview->currentSection(), QString("1")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 1); + listview->setContentY(20); QTRY_COMPARE(listview->currentSection(), QString("0")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 2); + item = findItem<QDeclarativeItem>(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); diff --git a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml new file mode 100644 index 0000000..bfc9a8d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml @@ -0,0 +1,15 @@ +import QtQuick 1.0 + +Loader { + id: myLoader + property int testProperty: 1912 + sourceComponent: loaderComponent + Component { + id: loaderComponent + Item { + Component.onCompleted: { + test = (myLoader.testProperty == 1912); + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml new file mode 100644 index 0000000..5297978 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +Item { + property bool test: false + + CreationContextLoader { + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro index b07bf9e..1e7808a 100644 --- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro +++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativeloader.cpp \ ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 8d04616..1bde55b 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -89,6 +89,7 @@ private slots: void deleteComponentCrash(); void nonItem(); void vmeErrors(); + void creationContext(); private: QDeclarativeEngine engine; @@ -562,6 +563,19 @@ void tst_QDeclarativeLoader::vmeErrors() delete loader; } +// QTBUG-13481 +void tst_QDeclarativeLoader::creationContext() +{ + QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_QDeclarativeLoader) #include "tst_qdeclarativeloader.moc" diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml new file mode 100644 index 0000000..a21ece7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml @@ -0,0 +1,4 @@ +import com.nokia.WrongCase 1.0 + +MyPluginType { value: 123 } + diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir new file mode 100644 index 0000000..6c87874 --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir @@ -0,0 +1 @@ +plugin PluGin diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp new file mode 100644 index 0000000..5e91f4e --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 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$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <QStringList> +#include <QtDeclarative/qdeclarativeextensionplugin.h> +#include <QtDeclarative/qdeclarative.h> +#include <QDebug> + +class MyPluginType : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue) + +public: + MyPluginType(QObject *parent=0) : QObject(parent) + { + qWarning("import worked"); + } + + int value() const { return v; } + void setValue(int i) { v = i; } + +private: + int v; +}; + + +class MyPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + MyPlugin() + { + qWarning("plugin created"); + } + + void registerTypes(const char *uri) + { + Q_ASSERT(QLatin1String(uri) == "com.nokia.WrongCase"); + qmlRegisterType<MyPluginType>(uri, 1, 0, "MyPluginType"); + } +}; + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(plugin, MyPlugin); diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro new file mode 100644 index 0000000..c7337ca --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro @@ -0,0 +1,10 @@ +TEMPLATE = lib +CONFIG += plugin +SOURCES = plugin.cpp +QT = core declarative +TARGET = Plugin +DESTDIR = ../imports/com/nokia/WrongCase + +symbian: { + TARGET.EPOCALLOWDLLDATA=1 +} diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro index 824b402..221e465 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro @@ -1,6 +1,6 @@ QT = core TEMPLATE = subdirs -SUBDIRS = plugin +SUBDIRS = plugin pluginWrongCase tst_qdeclarativemoduleplugin_pro.depends += plugin SUBDIRS += tst_qdeclarativemoduleplugin.pro diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index e1022e0..85fa718 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -54,6 +54,7 @@ public: private slots: void importsPlugin(); + void incorrectPluginCase(); }; #ifdef Q_OS_SYMBIAN @@ -120,6 +121,30 @@ void tst_qdeclarativemoduleplugin::importsPlugin() delete object; } +void tst_qdeclarativemoduleplugin::incorrectPluginCase() +{ + QDeclarativeEngine engine; + engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports")); + + QDeclarativeComponent component(&engine, TEST_FILE("data/incorrectCase.qml")); + + QList<QDeclarativeError> errors = component.errors(); + QCOMPARE(errors.count(), 1); + +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) +#if defined(Q_OS_MAC) + QString libname = "libPluGin.dylib"; +#elif defined(Q_OS_WIN32) + QString libname = "PluGin.dll"; +#endif + QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/" + libname) + QLatin1String("\""); +#else + QString expectedError = QLatin1String("module \"com.nokia.WrongCase\" plugin \"PluGin\" not found"); +#endif + + QCOMPARE(errors.at(0).description(), expectedError); +} + QTEST_MAIN(tst_qdeclarativemoduleplugin) #include "tst_qdeclarativemoduleplugin.moc" diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro index fb3630f..ec2d25e 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro @@ -4,7 +4,7 @@ QT += declarative CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml index 2348444..55b0812 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml @@ -4,11 +4,13 @@ Item { id: root property int clicked: 0 property int doubleClicked: 0 + property int released: 0 MouseArea { width: 200; height: 200 onClicked: { root.clicked++ } onDoubleClicked: { root.doubleClicked++ } + onReleased: { root.released++ } } } diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro index 3d39aa8..a93f7af 100644 --- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro +++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index e4ec01f..5a50e0d 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -356,6 +356,7 @@ void tst_QDeclarativeMouseArea::onMousePressRejected() canvas->show(); canvas->setFocus(); QVERIFY(canvas->rootObject() != 0); + QVERIFY(canvas->rootObject()->property("enabled").toBool()); QVERIFY(!canvas->rootObject()->property("mr1_pressed").toBool()); QVERIFY(!canvas->rootObject()->property("mr1_released").toBool()); @@ -412,14 +413,19 @@ void tst_QDeclarativeMouseArea::doubleClick() releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); + QCOMPARE(canvas->rootObject()->property("released").toInt(), 1); + QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick); dblClickEvent.setScenePos(QPointF(100, 100)); dblClickEvent.setButton(Qt::LeftButton); dblClickEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &dblClickEvent); + QApplication::sendEvent(scene, &releaseEvent); + QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1); QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1); + QCOMPARE(canvas->rootObject()->property("released").toInt(), 2); } QTEST_MAIN(tst_QDeclarativeMouseArea) diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro index f9ca90f..8f13573 100644 --- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro +++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeparticles.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml new file mode 100644 index 0000000..08b0d2a --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathQuad { + y: 120 + x: 80 + controlY: 330 + controlX: 100 + } + PathLine { + y: 160 + x: 20 + } + PathCubic { + y: 120 + x: 160 + control1Y: 0 + control1X: 100 + control2Y: 000 + control2X: 200 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml new file mode 100644 index 0000000..328e3cd --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathLine { + y: 160 + x: 20 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml new file mode 100644 index 0000000..0c2ac0c --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml @@ -0,0 +1,18 @@ +import QtQuick 1.0 + +Rectangle { + width: 400 + height: 400 + + PathView { + id: view + objectName: "pathView" + anchors.fill: parent + model: 10 + delegate: Rectangle { objectName: "wrapper"; color: "green"; width: 100; height: 100 } + path: Path { + startX: view.width/2; startY: 0 + PathLine { x: view.width/2; y: view.height } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro index 04fd26b..4f70a6f 100644 --- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro +++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepathview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 3b5d438..a2a5363 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -85,6 +85,8 @@ private slots: void pathUpdateOnStartChanged(); void package(); void emptyModel(); + void closed(); + void pathUpdate(); private: QDeclarativeView *createView(); @@ -349,6 +351,10 @@ void tst_QDeclarativePathView::dataModel() model.addItem("yellow", "7"); model.addItem("thistle", "8"); model.addItem("cyan", "9"); + model.addItem("peachpuff", "10"); + model.addItem("powderblue", "11"); + model.addItem("gold", "12"); + model.addItem("sandybrown", "13"); ctxt->setContextProperty("testData", &model); @@ -369,7 +375,7 @@ void tst_QDeclarativePathView::dataModel() model.insertItem(4, "orange", "10"); QTest::qWait(100); - QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 10); + QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 14); QVERIFY(pathview->currentIndex() == 0); @@ -418,6 +424,11 @@ void tst_QDeclarativePathView::dataModel() QVERIFY(item->property("onPath").toBool()); } + // QTBUG-14199 + pathview->setOffset(7); + pathview->setOffset(0); + QCOMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5); + delete canvas; } @@ -786,6 +797,43 @@ void tst_QDeclarativePathView::emptyModel() delete canvas; } +void tst_QDeclarativePathView::closed() +{ + QDeclarativeEngine engine; + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/openPath.qml")); + QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), false); + delete obj; + } + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/closedPath.qml")); + QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), true); + delete obj; + } +} + +// QTBUG-14239 +void tst_QDeclarativePathView::pathUpdate() +{ + QDeclarativeView *canvas = createView(); + QVERIFY(canvas); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdate.qml")); + + QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView"); + QVERIFY(pathView); + + QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "wrapper", 0); + QVERIFY(item); + QCOMPARE(item->x(), 150.0); + + delete canvas; +} QDeclarativeView *tst_QDeclarativePathView::createView() { diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro index 3130364..47b1b7b 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro +++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro @@ -10,7 +10,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro index 5dc7bb8..e98aa5c 100644 --- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro +++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativepositioners.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index 57a8354..254349f 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -322,7 +322,8 @@ void tst_QDeclarativePositioners::test_grid() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid"); + QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid"); + QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight); QCOMPARE(grid->width(), 120.0); QCOMPARE(grid->height(), 100.0); @@ -355,7 +356,8 @@ void tst_QDeclarativePositioners::test_grid_topToBottom() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid"); + QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid"); + QCOMPARE(grid->flow(), QDeclarativeGrid::TopToBottom); QCOMPARE(grid->width(), 100.0); QCOMPARE(grid->height(), 120.0); @@ -670,10 +672,12 @@ void tst_QDeclarativePositioners::test_flow_implicit_resize() QCOMPARE(flow->height(), 120.0); canvas->rootObject()->setProperty("leftToRight", true); + QCOMPARE(flow->flow(), QDeclarativeFlow::LeftToRight); QCOMPARE(flow->width(), 220.0); QCOMPARE(flow->height(), 50.0); canvas->rootObject()->setProperty("leftToRight", false); + QCOMPARE(flow->flow(), QDeclarativeFlow::TopToBottom); QCOMPARE(flow->width(), 100.0); QCOMPARE(flow->height(), 120.0); diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro index 4121a33..9dd727c 100644 --- a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro +++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeproperty.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml index c9fb25e..dc4049c 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml @@ -2,4 +2,7 @@ import QtQuick 1.0 QtObject { Component.onCompleted: Qt.openUrlExternally("test:url") + + property bool testFile + onTestFileChanged: Qt.openUrlExternally("test.html") } diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js new file mode 100644 index 0000000..702357a --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js @@ -0,0 +1,9 @@ +.pragma library + +function loadTest() { + Qt.openUrlExternally("test:url") +} + +function loadFile() { + Qt.openUrlExternally("test.html") +} diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml new file mode 100644 index 0000000..456653b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml @@ -0,0 +1,9 @@ +import QtQuick 1.0 +import "openUrlExternally_lib.js" as Test + +Item { + Component.onCompleted: Test.loadTest(); + + property bool testFile + onTestFileChanged: Test.loadFile(); +} diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro index 6af6500..a12c439 100644 --- a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro +++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeqt.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 739b10a..9f45d74 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -75,6 +75,7 @@ private slots: void darker(); void tint(); void openUrlExternally(); + void openUrlExternally_pragmaLibrary(); void md5(); void createComponent(); void createComponent_pragmaLibrary(); @@ -321,6 +322,7 @@ void tst_qdeclarativeqt::openUrlExternally() MyUrlHandler handler; QDesktopServices::setUrlHandler("test", &handler, "noteCall"); + QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally.qml")); QObject *object = component.create(); @@ -328,7 +330,35 @@ void tst_qdeclarativeqt::openUrlExternally() QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); + object->setProperty("testFile", true); + + QCOMPARE(handler.called,2); + QCOMPARE(handler.last, TEST_FILE("test.html")); + + QDesktopServices::unsetUrlHandler("test"); + QDesktopServices::unsetUrlHandler("file"); +} + +void tst_qdeclarativeqt::openUrlExternally_pragmaLibrary() +{ + MyUrlHandler handler; + + QDesktopServices::setUrlHandler("test", &handler, "noteCall"); + QDesktopServices::setUrlHandler("file", &handler, "noteCall"); + + QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally_lib.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(handler.called,1); + QCOMPARE(handler.last, QUrl("test:url")); + + object->setProperty("testFile", true); + + QCOMPARE(handler.called,2); + QCOMPARE(handler.last, TEST_FILE("test.html")); + QDesktopServices::unsetUrlHandler("test"); + QDesktopServices::unsetUrlHandler("file"); } void tst_qdeclarativeqt::md5() diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro index f3ff9ed..385b8da 100644 --- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro +++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativerepeater.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro index c2d30a0..dedb263 100644 --- a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro +++ b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro @@ -9,7 +9,7 @@ INCLUDEPATH += ../shared # LIBS += -lgcov symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro index 872aeb9..69f331b 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesmoothedanimation.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro index 213b262..a59522b 100644 --- a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro +++ b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativespringanimation.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro index 1462c9a..d938692 100644 --- a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro +++ b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesqldatabase.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro index 2bae041..2f32178 100644 --- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro +++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativestates.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png Binary files differindex b5c6bba..cf6199a 100644 --- a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png +++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png Binary files differindex c9ffcc1..f81ccb4 100644 --- a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png +++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png Binary files differindex eda0d25..9ba6412 100644 --- a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png +++ b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro index c1a36fd..362886e 100644 --- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro +++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro @@ -10,7 +10,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro index 4b6bd49..cf706ba 100644 --- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro +++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro @@ -6,7 +6,7 @@ SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp HEADERS += ../shared/testhttpserver.h symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 472c5ef..a7971cc 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -56,6 +56,8 @@ #include <QDir> #include <QStyle> #include <QInputContext> +#include <QClipboard> +#include <QMimeData> #include <private/qapplication_p.h> #include <private/qtextcontrol_p.h> @@ -119,6 +121,8 @@ private slots: void openInputPanelOnClick(); void openInputPanelOnFocus(); void geometrySignals(); + void pastingRichText_QTBUG_14003(); + private: void simulateKey(QDeclarativeView *, int key); QDeclarativeView *createView(const QString &filename); @@ -1174,6 +1178,27 @@ void tst_qdeclarativetextedit::geometrySignals() delete o; } +void tst_qdeclarativetextedit::pastingRichText_QTBUG_14003() +{ +#ifndef QT_NO_CLIPBOARD + QString componentStr = "import QtQuick 1.0\nTextEdit { textFormat: TextEdit.PlainText }"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeTextEdit *obj = qobject_cast<QDeclarativeTextEdit*>(component.create()); + + QTRY_VERIFY(obj != 0); + QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText); + + QMimeData *mData = new QMimeData; + mData->setHtml("<font color=\"red\">Hello</font>"); + QApplication::clipboard()->setMimeData(mData); + + obj->paste(); + QTRY_VERIFY(obj->text() == ""); + QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText); +#endif +} + QTEST_MAIN(tst_qdeclarativetextedit) #include "tst_qdeclarativetextedit.moc" diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro index 8f42448..5c45f57 100644 --- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro +++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetextinput.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro index 90e46d3..a208254 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro +++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativevaluetypes.cpp \ testtypes.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro index 21a9195..4436d54 100644 --- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro +++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro index 6189916..5ba416e 100644 --- a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro +++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro @@ -7,7 +7,7 @@ include(../../../../tools/qml/qml.pri) SOURCES += tst_qdeclarativeviewer.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro index 92e5f60..16154f3 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativevisualdatamodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro index 562a9fb..cc7fa43 100644 --- a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro +++ b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativewebview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro index 2f8f23d..eca8a68 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro +++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeworkerscript.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro index 619b239..fbcc597 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro @@ -9,7 +9,7 @@ SOURCES += tst_qdeclarativexmlhttprequest.cpp \ ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml new file mode 100644 index 0000000..492dad9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +XmlListModel { + id: model + XmlRole {} + Component.onCompleted: model.roles = 0 +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro index 472cffb..23173f3 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro +++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro @@ -9,7 +9,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativexmllistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index bd19bd3..a14f942 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -96,6 +96,8 @@ private slots: void threading_data(); void propertyChanges(); + void roleCrash(); + private: QString makeItemXmlAndData(const QString &data, QDeclarativeXmlModelData *modelData = 0) const { @@ -825,6 +827,15 @@ void tst_qdeclarativexmllistmodel::propertyChanges() delete model; } +void tst_qdeclarativexmllistmodel::roleCrash() +{ + // don't crash + QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleCrash.qml")); + QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create()); + QVERIFY(model != 0); + delete model; +} + QTEST_MAIN(tst_qdeclarativexmllistmodel) #include "tst_qdeclarativexmllistmodel.moc" diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro index cb7e5d7..a424b8f 100644 --- a/tests/auto/declarative/qmlvisual/qmlvisual.pro +++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro @@ -6,7 +6,7 @@ SOURCES += tst_qmlvisual.cpp symbian: { importFiles.path = . - importFiles.sources = animation \ + importFiles.files = animation \ fillmode \ focusscope \ ListView \ diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro index e887df4..ea78e63 100755 --- a/tests/auto/mediaobject/mediaobject.pro +++ b/tests/auto/mediaobject/mediaobject.pro @@ -15,7 +15,7 @@ wince*{ } symbian:{ - addFiles.sources = media/test.sdp + addFiles.files = media/test.sdp addFiles.path = media DEPLOYMENT += addFiles } diff --git a/tests/auto/moc/moc.pro b/tests/auto/moc/moc.pro index a89ff07..4fb9ac4 100644 --- a/tests/auto/moc/moc.pro +++ b/tests/auto/moc/moc.pro @@ -17,7 +17,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n escapes-in-string-literals.h cstyle-enums.h qprivateslots.h gadgetwithnoenums.h \ dir-in-include-path.h single_function_keyword.h task192552.h task189996.h \ task234909.h task240368.h pure-virtual-signals.h -if(*-g++*|*-icc*):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h +if(*-g++*|*-icc*|*-clang|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h SOURCES += tst_moc.cpp QT += sql network svg diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro index d7cb7f3..b7c70a1 100644 --- a/tests/auto/networkselftest/networkselftest.pro +++ b/tests/auto/networkselftest/networkselftest.pro @@ -4,12 +4,12 @@ SOURCES += tst_networkselftest.cpp QT = core network wince*: { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT = addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT = addFiles } else:vxworks*: { diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro index f83e0aa..098b0fe 100644 --- a/tests/auto/patternistexamples/patternistexamples.pro +++ b/tests/auto/patternistexamples/patternistexamples.pro @@ -2,17 +2,17 @@ load(qttest_p4) SOURCES += tst_patternistexamples.cpp CONFIG += qtestlib wince*|symbian: { - snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/* + snippets.files = $$QT_SOURCE_TREE/doc/src/snippets/patternist/* snippets.path = patternist - widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/* + widgetRen.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/* widgetRen.path = widgetRenderer - globVar.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/* + globVar.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/* globVar.path = globalVariables - filetree.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/* + filetree.files = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/* filetree.path = filetree - recipes.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/* + recipes.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/* recipes.path = recipes - files.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/* + files.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/* files.path = recipes\\files DEPLOYMENT += snippets widgetRen globVar filetree recipes files diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro index 2e2577d..6f5044f 100644 --- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro @@ -4,7 +4,7 @@ QT -= gui SOURCES += tst_qabstractnetworkcache.cpp wince*|symbian: { - testFiles.sources = tests + testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro index a18f4ca..b8f509d 100644 --- a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro +++ b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro @@ -7,7 +7,7 @@ HEADERS += TestNodeModel.h LoadingModel.h include (../xmlpatterns.pri) wince*: { - addFiles.sources = tree.xml + addFiles.files = tree.xml addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index 1b30beb..a4f606c 100644 --- a/tests/auto/qaccessibility/qaccessibility.pro +++ b/tests/auto/qaccessibility/qaccessibility.pro @@ -5,7 +5,7 @@ unix:!mac:LIBS+=-lm contains(QT_CONFIG, qt3support): QT += qt3support wince*: { - accessneeded.sources = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll + accessneeded.files = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll accessneeded.path = accessible DEPLOYMENT += accessneeded }
\ No newline at end of file diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index 2c54c37..4c8e9b0 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -4,19 +4,19 @@ SOURCES += ../tst_qapplication.cpp TARGET = ../tst_qapplication wince* { - additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe + additional.files = ../desktopsettingsaware/desktopsettingsaware.exe additional.path = desktopsettingsaware - someTest.sources = test.pro + someTest.files = test.pro someTest.path = test DEPLOYMENT = additional deploy someTest } symbian: { - additional.sources = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe + additional.files = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe additional.path = desktopsettingsaware - someTest.sources = test.pro + someTest.files = test.pro someTest.path = test - windowIcon.sources = ../heart.svg + windowIcon.files = ../heart.svg DEPLOYMENT = additional deploy someTest windowIcon LIBS += -lcone -lavkon } diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index 91ae921..a198d7f 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -147,6 +147,10 @@ private slots: void symbianNeedForTraps(); void symbianLeaveThroughMain(); void qtbug_12673(); + + + + void globalStaticObjectDestruction(); // run this last }; class EventSpy : public QObject @@ -2257,6 +2261,42 @@ void tst_QApplication::qtbug_12673() #endif // Q_OS_SYMBIAN } +/* + This test is meant to ensure that certain objects (public & commonly used) + can safely be used in a Q_GLOBAL_STATIC such that their destructors are + executed *after* the destruction of QApplication. + */ +Q_GLOBAL_STATIC(QLocale, tst_qapp_locale); +Q_GLOBAL_STATIC(QProcess, tst_qapp_process); +Q_GLOBAL_STATIC(QFileSystemWatcher, tst_qapp_fileSystemWatcher); +Q_GLOBAL_STATIC(QSharedMemory, tst_qapp_sharedMemory); +Q_GLOBAL_STATIC(QElapsedTimer, tst_qapp_elapsedTimer); +Q_GLOBAL_STATIC(QMutex, tst_qapp_mutex); +Q_GLOBAL_STATIC(QWidget, tst_qapp_widget); +Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap); +Q_GLOBAL_STATIC(QFont, tst_qapp_font); +Q_GLOBAL_STATIC(QRegion, tst_qapp_region); +Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase); +Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor); + +void tst_QApplication::globalStaticObjectDestruction() +{ + int argc = 1; + QApplication app(argc, &argv0, QApplication::GuiServer); + QVERIFY(tst_qapp_locale()); + QVERIFY(tst_qapp_process()); + QVERIFY(tst_qapp_fileSystemWatcher()); + QVERIFY(tst_qapp_sharedMemory()); + QVERIFY(tst_qapp_elapsedTimer()); + QVERIFY(tst_qapp_mutex()); + QVERIFY(tst_qapp_widget()); + QVERIFY(tst_qapp_pixmap()); + QVERIFY(tst_qapp_font()); + QVERIFY(tst_qapp_region()); + QVERIFY(tst_qapp_fontDatabase()); + QVERIFY(tst_qapp_cursor()); +} + //QTEST_APPLESS_MAIN(tst_QApplication) int main(int argc, char *argv[]) { diff --git a/tests/auto/qaudioinput/qaudioinput.pro b/tests/auto/qaudioinput/qaudioinput.pro index 5eb1613..922c3e4 100644 --- a/tests/auto/qaudioinput/qaudioinput.pro +++ b/tests/auto/qaudioinput/qaudioinput.pro @@ -5,7 +5,7 @@ SOURCES += tst_qaudioinput.cpp QT = core multimedia wince* { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy DEFINES += SRCDIR=\\\"\\\" QT += gui diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro index e1734e0..0bd0151 100644 --- a/tests/auto/qaudiooutput/qaudiooutput.pro +++ b/tests/auto/qaudiooutput/qaudiooutput.pro @@ -5,7 +5,7 @@ SOURCES += tst_qaudiooutput.cpp QT = core multimedia wince*|symbian: { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy !symbian { DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro index a0c143e..35e48ad 100644 --- a/tests/auto/qbytearray/qbytearray.pro +++ b/tests/auto/qbytearray/qbytearray.pro @@ -5,7 +5,7 @@ SOURCES += tst_qbytearray.cpp QT = core wince*|symbian { - addFile.sources = rfc3252.txt + addFile.files = rfc3252.txt addFile.path = . DEPLOYMENT += addFile } diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 3813e4e..9cfccc2 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -4,7 +4,7 @@ SOURCES += tst_qchar.cpp QT = core wince*|symbian: { -deploy.sources += NormalizationTest.txt +deploy.files += NormalizationTest.txt DEPLOYMENT = deploy } diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro index 0f8cad1..7d5c2f3 100644 --- a/tests/auto/qclipboard/test/test.pro +++ b/tests/auto/qclipboard/test/test.pro @@ -11,18 +11,18 @@ win32 { } wince*|symbian: { - copier.sources = ../copier/copier.exe + copier.files = ../copier/copier.exe copier.path = copier - paster.sources = ../paster/paster.exe + paster.files = ../paster/paster.exe paster.path = paster symbian: { load(data_caging_paths) - rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc - rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc + rsc.files = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc + rsc.files += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc rsc.path = $$APP_RESOURCE_DIR - reg_resource.sources = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc - reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc + reg_resource.files = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc + reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc reg_resource.path = $$REG_RESOURCE_IMPORT_DIR } diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 674064f..f696f19 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -8,9 +8,9 @@ requires(contains(QT_CONFIG,private_tests)) } wince*|symbian: { - addFiles.sources = testdata + addFiles.files = testdata addFiles.path = . - timesFont.sources = C:/Windows/Fonts/times.ttf + timesFont.files = C:/Windows/Fonts/times.ttf timesFont.path = . DEPLOYMENT += addFiles timesFont } diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro index c132073..eba7c00 100644 --- a/tests/auto/qdatastream/qdatastream.pro +++ b/tests/auto/qdatastream/qdatastream.pro @@ -12,13 +12,13 @@ QT += svg wince*: { - addFiles.sources = datastream.q42 tests2.svg + addFiles.files = datastream.q42 tests2.svg addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { # SRCDIR and SVGFILE defined in code in symbian - addFiles.sources = datastream.q42 tests2.svg + addFiles.files = datastream.q42 tests2.svg addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE = 1000000 10000000 diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index d32ed4c..43f6cba 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -3,22 +3,22 @@ CONFIG += qttest_p4 SOURCES += tst_qdesktopservices.cpp TARGET = tst_qdesktopservices symbian: { - dummy.sources = text\\testfile.txt + dummy.files = text\\testfile.txt dummy.path = . - text.sources = text\\* + text.files = text\\* text.path = \\data\\others - image.sources = image\\* + image.files = image\\* image.path = \\data\\images - audio.sources = audio\\* + audio.files = audio\\* audio.path = \\data\\sounds - video.sources = video\\* + video.files = video\\* video.path = \\data\\videos - install.sources = install\\* + install.files = install\\* install.path = \\data\\installs DEPLOYMENT += image audio video install diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro index cf612f1..818f52c 100644 --- a/tests/auto/qdir/qdir.pro +++ b/tests/auto/qdir/qdir.pro @@ -4,7 +4,7 @@ RESOURCES += qdir.qrc QT = core wince*|symbian { - DirFiles.sources = testdir testdata searchdir resources entrylist types tst_qdir.cpp + DirFiles.files = testdir testdata searchdir resources entrylist types tst_qdir.cpp DirFiles.path = . DEPLOYMENT += DirFiles } diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro index d60b52d..020b229 100644 --- a/tests/auto/qdiriterator/qdiriterator.pro +++ b/tests/auto/qdiriterator/qdiriterator.pro @@ -4,7 +4,7 @@ RESOURCES += qdiriterator.qrc QT = core wince*|symbian: { - addFiles.sources = entrylist recursiveDirs foo + addFiles.files = entrylist recursiveDirs foo addFiles.path = . DEPLOYMENT += addFiles wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro index 36929b9..7037a79 100644 --- a/tests/auto/qdirmodel/qdirmodel.pro +++ b/tests/auto/qdirmodel/qdirmodel.pro @@ -2,11 +2,11 @@ load(qttest_p4) SOURCES += tst_qdirmodel.cpp wince*|symbian { - addit.sources = dirtest\\test1\\* + addit.files = dirtest\\test1\\* addit.path = dirtest\\test1 - tests.sources = test\\* + tests.files = test\\* tests.path = test - sourceFile.sources = tst_qdirmodel.cpp + sourceFile.files = tst_qdirmodel.cpp sourceFile.path = . DEPLOYMENT += addit tests sourceFile } diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro index 9040b91..0a3c167 100644 --- a/tests/auto/qdom/qdom.pro +++ b/tests/auto/qdom/qdom.pro @@ -5,7 +5,7 @@ QT = core xml QT -= gui wince*|symbian: { - addFiles.sources = testdata doubleNamespaces.xml umlaut.xml + addFiles.files = testdata doubleNamespaces.xml umlaut.xml addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro index 70c93ce..c657e9a 100644 --- a/tests/auto/qfile/test/test.pro +++ b/tests/auto/qfile/test/test.pro @@ -3,11 +3,11 @@ SOURCES += ../tst_qfile.cpp wince*|symbian { QT = core gui - files.sources += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \ + files.files += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \ ..\\testlog.txt ..\\two.dots.file ..\\tst_qfile.cpp \ ..\\Makefile ..\\forCopying.txt ..\\forRenaming.txt files.path = . - resour.sources += ..\\resources\\file1.ext1 + resour.files += ..\\resources\\file1.ext1 resour.path = resources DEPLOYMENT = files resour diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro index 2b87cf1..68f2e3c 100644 --- a/tests/auto/qfiledialog/qfiledialog.pro +++ b/tests/auto/qfiledialog/qfiledialog.pro @@ -7,9 +7,9 @@ load(qttest_p4) SOURCES += tst_qfiledialog.cpp wince*|symbian { - addFiles.sources = *.cpp + addFiles.files = *.cpp addFiles.path = . - filesInDir.sources = *.pro + filesInDir.files = *.pro filesInDir.path = someDir DEPLOYMENT += addFiles filesInDir } diff --git a/tests/auto/qfiledialog2/qfiledialog2.pro b/tests/auto/qfiledialog2/qfiledialog2.pro index 4ebf977..b8924c1 100644 --- a/tests/auto/qfiledialog2/qfiledialog2.pro +++ b/tests/auto/qfiledialog2/qfiledialog2.pro @@ -7,9 +7,9 @@ load(qttest_p4) SOURCES += tst_qfiledialog2.cpp wince*|symbian { - addFiles.sources = *.cpp + addFiles.files = *.cpp addFiles.path = . - filesInDir.sources = *.pro + filesInDir.files = *.pro filesInDir.path = someDir DEPLOYMENT += addFiles filesInDir } diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index 30656e2..3141db6 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -7,8 +7,8 @@ QT = core RESOURCES += qfileinfo.qrc wince*:|symbian: { - deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp - res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2 + deploy.files += qfileinfo.qrc tst_qfileinfo.cpp + res.files = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2 res.path = resources DEPLOYMENT = deploy res } diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index 070eb6a..04cea48 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -9,7 +9,7 @@ symbian: { HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h # need to deploy something to create the private directory - dummyDeploy.sources = tst_qfilesystemmodel.cpp + dummyDeploy.files = tst_qfilesystemmodel.cpp dummyDeploy.path = . DEPLOYMENT += dummyDeploy LIBS += -lefsrv diff --git a/tests/auto/qfontdatabase/qfontdatabase.pro b/tests/auto/qfontdatabase/qfontdatabase.pro index 35811f1..e7dfc3c 100644 --- a/tests/auto/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/qfontdatabase/qfontdatabase.pro @@ -3,7 +3,7 @@ SOURCES += tst_qfontdatabase.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian { - additionalFiles.sources = FreeMono.ttf + additionalFiles.files = FreeMono.ttf additionalFiles.path = . DEPLOYMENT += additionalFiles } diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro index 9618962..ac1702e 100644 --- a/tests/auto/qftp/qftp.pro +++ b/tests/auto/qftp/qftp.pro @@ -5,12 +5,12 @@ SOURCES += tst_qftp.cpp QT = core network wince*: { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp index 38b0dab..9441406 100644 --- a/tests/auto/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/qglthreads/tst_qglthreads.cpp @@ -45,6 +45,10 @@ #include <QtOpenGL/QtOpenGL> #include "tst_qglthreads.h" +#ifdef Q_OS_SYMBIAN +#include <unistd.h> // for usleep +#endif + #define RUNNING_TIME 5000 tst_QGLThreads::tst_QGLThreads(QObject *parent) @@ -203,6 +207,7 @@ public: p.drawText(image.rect(), Qt::AlignCenter, "This is an autotest"); p.end(); m_gl->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); + createdAndUploaded(image); } } diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 25ec040..2ddccd2 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -445,6 +445,7 @@ private slots: void textItem_shortcuts(); void scroll(); void stopClickFocusPropagation(); + void deviceCoordinateCache_simpleRotations(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -9064,6 +9065,9 @@ void tst_QGraphicsItem::focusScope() scope2->hide(); scope2->show(); QVERIFY(!scope2->hasFocus()); + QVERIFY(scope1->hasFocus()); + scope2->setFocus(); + scope3->setFocus(); QVERIFY(scope3->hasFocus()); QGraphicsRectItem *rect4 = new QGraphicsRectItem; @@ -10560,6 +10564,81 @@ void tst_QGraphicsItem::stopClickFocusPropagation() QVERIFY(itemWithFocus->hasFocus()); } +void tst_QGraphicsItem::deviceCoordinateCache_simpleRotations() +{ + // Make sure we don't invalidate the cache when applying simple + // (90, 180, 270, 360) rotation transforms to the item. + QGraphicsRectItem *item = new QGraphicsRectItem(0, 0, 300, 200); + item->setBrush(Qt::red); + item->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + + QGraphicsScene scene; + scene.setSceneRect(0, 0, 300, 200); + scene.addItem(item); + + MyGraphicsView view(&scene); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.repaints > 0); + + QGraphicsItemCache *itemCache = QGraphicsItemPrivate::get(item)->extraItemCache(); + Q_ASSERT(itemCache); + QPixmapCache::Key currentKey = itemCache->deviceData.value(view.viewport()).key; + + // Trigger an update and verify that the cache is unchanged. + QPixmapCache::Key oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QCOMPARE(currentKey, oldKey); + + // Check 90, 180, 270 and 360 degree rotations. + for (int angle = 90; angle <= 360; angle += 90) { + // Rotate item and verify that the cache was invalidated. + oldKey = currentKey; + view.reset(); + QTransform transform; + transform.translate(150, 100); + transform.rotate(angle); + transform.translate(-150, -100); + item->setTransform(transform); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); + + // IMPORTANT PART: + // Trigger an update and verify that the cache is unchanged. + oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QCOMPARE(currentKey, oldKey); + } + + // 45 degree rotation. + oldKey = currentKey; + view.reset(); + QTransform transform; + transform.translate(150, 100); + transform.rotate(45); + transform.translate(-150, -100); + item->setTransform(transform); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); + + // Trigger an update and verify that the cache was invalidated. + // We should always invalidate the cache for non-trivial transforms. + oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); +} + void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor() { struct Item : public QGraphicsTextItem diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 411c790..ad7ccf7 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -183,6 +183,7 @@ private slots: void inputMethod(); void clickFocus(); void windowFrameMargins(); + void QTBUG_6986_sendMouseEventToAlienWidget(); }; // Subclass that exposes the protected functions. @@ -3583,6 +3584,70 @@ void tst_QGraphicsProxyWidget::windowFrameMargins() QVERIFY(top > 0); } +class HoverButton : public QPushButton +{ +public: + HoverButton(QWidget *parent = 0) : QPushButton(parent), hoverLeaveReceived(false) + {} + + bool hoverLeaveReceived; + + bool event(QEvent* e) + { + if(QEvent::HoverLeave == e->type()) + hoverLeaveReceived = true; + return QPushButton::event(e); + } +}; + +class Scene : public QGraphicsScene +{ +Q_OBJECT +public: + Scene() { + QWidget *background = new QWidget; + background->setGeometry(0, 0, 500, 500); + hoverButton = new HoverButton; + hoverButton->setParent(background); + hoverButton->setText("Second button"); + hoverButton->setGeometry(10, 10, 200, 50); + addWidget(background); + + QPushButton *hideButton = new QPushButton("I'm a button with a very very long text"); + hideButton->setGeometry(10, 10, 400, 50); + topButton = addWidget(hideButton); + connect(hideButton, SIGNAL(clicked()), this, SLOT(hideButton())); + topButton->setFocus(); + } + + QGraphicsProxyWidget *topButton; + HoverButton *hoverButton; + +public slots: + void hideButton() { + QCursor::setPos(600,600); + topButton->hide(); + } +}; + +void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget() +{ +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR) + QSKIP("Test case unstable on this platform", SkipAll); +#endif + QGraphicsView view; + Scene scene; + view.setScene(&scene); + view.resize(600, 600); + QApplication::setActiveWindow(&view); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_COMPARE(QApplication::activeWindow(), &view); + QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center()))); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos())); + QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true); +} + QTEST_MAIN(tst_QGraphicsProxyWidget) #include "tst_qgraphicsproxywidget.moc" diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro index cc6f585..82fa423 100644 --- a/tests/auto/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro @@ -7,9 +7,9 @@ win32:!wince*: LIBS += -lUser32 DEFINES += QT_NO_CAST_TO_ASCII wince*|symbian: { - rootFiles.sources = Ash_European.jpg graphicsScene_selection.data + rootFiles.files = Ash_European.jpg graphicsScene_selection.data rootFiles.path = . - renderFiles.sources = testData\\render\\* + renderFiles.files = testData\\render\\* renderFiles.path = testData\\render DEPLOYMENT += rootFiles renderFiles } diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro index 889aac9..a9a8ed9 100644 --- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro +++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro @@ -9,9 +9,9 @@ DEFINES += QT_USE_USING_NAMESPACE wince*: { DEFINES += SRCDIR=\\\"./\\\" QT += network - addFiles.sources = $$PWD/data/*.* + addFiles.files = $$PWD/data/*.* addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll DEPLOYMENT += addFiles DEPLOYMENT += clucene diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro index 27ebd0f..4166fe2 100644 --- a/tests/auto/qhelpenginecore/qhelpenginecore.pro +++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro @@ -10,9 +10,9 @@ DEFINES += QT_USE_USING_NAMESPACE wince*: { DEFINES += SRCDIR=\\\"./\\\" QT += network - addFiles.sources = $$PWD/data/*.* + addFiles.files = $$PWD/data/*.* addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll DEPLOYMENT += addFiles DEPLOYMENT += clucene diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index c0be518..5b102ce 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -5,20 +5,20 @@ SOURCES += tst_qhttp.cpp QT = core network wince*: { - webFiles.sources = webserver/* + webFiles.files = webserver/* webFiles.path = webserver - cgi.sources = webserver/cgi-bin/* + cgi.files = webserver/cgi-bin/* cgi.path = webserver/cgi-bin - addFiles.sources = rfc3252.txt trolltech + addFiles.files = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi DEFINES += SRCDIR=\\\"\\\" } else:symbian { - webFiles.sources = webserver/* + webFiles.files = webserver/* webFiles.path = webserver - cgi.sources = webserver/cgi-bin/* + cgi.files = webserver/cgi-bin/* cgi.path = webserver/cgi-bin - addFiles.sources = rfc3252.txt trolltech + addFiles.files = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro index cabab3f..c150c9a 100644 --- a/tests/auto/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/qicoimageformat/qicoimageformat.pro @@ -3,21 +3,21 @@ SOURCES+= tst_qicoimageformat.cpp wince*: { DEFINES += SRCDIR=\\\".\\\" - addFiles.sources = icons + addFiles.files = icons addFiles.path = . CONFIG(debug, debug|release):{ - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll } else { - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll } addPlugins.path = imageformats DEPLOYMENT += addFiles addPlugins } else:symbian { - addFiles.sources = icons + addFiles.files = icons addFiles.path = . DEPLOYMENT += addFiles qt_not_deployed { - addPlugins.sources = qico.dll + addPlugins.files = qico.dll addPlugins.path = imageformats DEPLOYMENT += addPlugins } diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro index 68b888d..975aaf2 100644 --- a/tests/auto/qicon/qicon.pro +++ b/tests/auto/qicon/qicon.pro @@ -5,10 +5,10 @@ RESOURCES = tst_qicon.qrc wince* { QT += xml svg - addFiles.sources += $$_PRO_FILE_PWD_/*.png - addFiles.sources += $$_PRO_FILE_PWD_/*.svg - addFiles.sources += $$_PRO_FILE_PWD_/*.svgz - addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp + addFiles.files += $$_PRO_FILE_PWD_/*.png + addFiles.files += $$_PRO_FILE_PWD_/*.svg + addFiles.files += $$_PRO_FILE_PWD_/*.svgz + addFiles.files += $$_PRO_FILE_PWD_/tst_qicon.cpp addFiles.path = . DEPLOYMENT += addFiles @@ -16,11 +16,11 @@ wince* { DEFINES += SRCDIR=\\\".\\\" } else:symbian { QT += xml svg - addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz + addFiles.files = *.png tst_qicon.cpp *.svg *.svgz addFiles.path = . DEPLOYMENT += addFiles qt_not_deployed { - plugins.sources = qsvgicon.dll + plugins.files = qsvgicon.dll plugins.path = iconengines DEPLOYMENT += plugins } diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro index 6469211..798c82e 100644 --- a/tests/auto/qimage/qimage.pro +++ b/tests/auto/qimage/qimage.pro @@ -2,17 +2,17 @@ load(qttest_p4) SOURCES += tst_qimage.cpp wince*: { - addImages.sources = images/* + addImages.files = images/* addImages.path = images DEPLOYMENT += addImages DEFINES += SRCDIR=\\\".\\\" } else:symbian { TARGET.EPOCHEAPSIZE = 0x200000 0x800000 - addImages.sources = images/* + addImages.files = images/* addImages.path = images DEPLOYMENT += addImages qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index f8fc7fa..827819d 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -17,10 +17,10 @@ win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300 win32-msvc.net:QMAKE_CXXFLAGS += -Zm1100 wince*: { - images.sources = images + images.files = images images.path = . - imagePlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/*.dll + imagePlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*.dll imagePlugins.path = imageformats DEPLOYMENT += images imagePlugins @@ -28,13 +28,13 @@ wince*: { } symbian: { - images.sources = images + images.files = images images.path = . DEPLOYMENT += images qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro index f25472f..bab2419 100644 --- a/tests/auto/qimagewriter/qimagewriter.pro +++ b/tests/auto/qimagewriter/qimagewriter.pro @@ -6,16 +6,16 @@ win32-msvc:QMAKE_CXXFLAGS -= -Zm200 win32-msvc:QMAKE_CXXFLAGS += -Zm800 wince*: { - addFiles.sources = images\\*.* + addFiles.files = images\\*.* addFiles.path = images DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\".\\\" } else:symbian { - addFiles.sources = images\\*.* + addFiles.files = images\\*.* addFiles.path = images DEPLOYMENT += addFiles qt_not_deployed { - imagePlugins.sources = qjpeg.dll qtiff.dll + imagePlugins.files = qjpeg.dll qtiff.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp index 0d6644a..5d03142 100644 --- a/tests/auto/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp @@ -74,6 +74,7 @@ private slots: void getItem_data(); void getItem(); void task256299_getTextReturnNullStringOnRejected(); + void inputMethodHintsOfChildWidget(); }; QString stripFraction(const QString &s) @@ -404,5 +405,24 @@ void tst_QInputDialog::getItem() delete parent; } +void tst_QInputDialog::inputMethodHintsOfChildWidget() +{ + QInputDialog dialog; + dialog.setInputMode(QInputDialog::TextInput); + QList<QObject *> children = dialog.children(); + QLineEdit *editWidget = 0; + for (int c = 0; c < children.size(); c++) { + editWidget = qobject_cast<QLineEdit *>(children.at(c)); + if (editWidget) + break; + } + QVERIFY(editWidget); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhNone); + dialog.setInputMethodHints(Qt::ImhDigitsOnly); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhDigitsOnly); +} + QTEST_MAIN(tst_QInputDialog) #include "tst_qinputdialog.moc" diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro index 716cdce..29b0a05 100644 --- a/tests/auto/qiodevice/qiodevice.pro +++ b/tests/auto/qiodevice/qiodevice.pro @@ -4,14 +4,14 @@ SOURCES += tst_qiodevice.cpp QT = core network wince*: { - addFiles.sources = tst_qiodevice.cpp + addFiles.files = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" !wince50standard-x86-msvc2005: DEFINES += WINCE_EMULATOR_TEST=1 } else:symbian { # SRCDIR defined in code in symbian - addFiles.sources = tst_qiodevice.cpp + addFiles.files = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro index 92709fe..b348a18 100644 --- a/tests/auto/qitemmodel/qitemmodel.pro +++ b/tests/auto/qitemmodel/qitemmodel.pro @@ -9,7 +9,7 @@ QT += sql # memory on Windows Mobile 5. #wince*: { -# plugFiles.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll +# plugFiles.files = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll # plugFiles.path = sqldrivers # DEPLOYMENT += plugFiles #} @@ -19,7 +19,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro index 297f868..057a6f1 100644 --- a/tests/auto/qlabel/qlabel.pro +++ b/tests/auto/qlabel/qlabel.pro @@ -3,7 +3,7 @@ SOURCES += tst_qlabel.cpp wince*::DEFINES += SRCDIR=\\\"\\\" else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" wince*|symbian { - addFiles.sources = *.png \ + addFiles.files = *.png \ testdata addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index c99f1d9..dfa8584 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -7,7 +7,7 @@ load(qttest_p4) SOURCES += tst_qlayout.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = baseline + addFiles.files = baseline addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro index 4c647c0..28c40b0 100644 --- a/tests/auto/qlibrary/tst/tst.pro +++ b/tests/auto/qlibrary/tst/tst.pro @@ -12,18 +12,18 @@ win32 { } wince*: { - addFiles.sources = ../*.dll ../*.dl2 ../mylib_noextension + addFiles.files = ../*.dll ../*.dl2 ../mylib_noextension addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" }else:symbian { - binDep.sources = \ + binDep.files = \ mylib.dll \ system.trolltech.test.mylib.dll binDep.path = /sys/bin #mylib.dl2 nonstandard binary deployment will cause warning in emulator, #but it can be safely ignored. - custBinDep.sources = mylib.dl2 + custBinDep.files = mylib.dl2 custBinDep.path = /sys/bin DEPLOYMENT += binDep custBinDep diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index eb3fb6b..8aa50d3 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -133,6 +133,7 @@ private slots: void task217070_scrollbarsAdjusted(); void task258949_keypressHangup(); void QTBUG8086_currentItemChangedOnClick(); + void QTBUG14363_completerWithAnyKeyPressedEditTriggers(); protected slots: @@ -1640,5 +1641,44 @@ void tst_QListWidget::QTBUG8086_currentItemChangedOnClick() } +class ItemDelegate : public QItemDelegate +{ +public: + ItemDelegate(QObject *parent = 0) : QItemDelegate(parent) + {} + virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const + { + QLineEdit *lineEdit = new QLineEdit(parent); + lineEdit->setFrame(false); + QCompleter *completer = new QCompleter(QStringList() << "completer", lineEdit); + completer->setCompletionMode(QCompleter::InlineCompletion); + lineEdit->setCompleter(completer); + return lineEdit; + } +}; + +void tst_QListWidget::QTBUG14363_completerWithAnyKeyPressedEditTriggers() +{ + QListWidget listWidget; + listWidget.setEditTriggers(QAbstractItemView::AnyKeyPressed); + listWidget.setItemDelegate(new ItemDelegate); + QListWidgetItem *item = new QListWidgetItem(QLatin1String("select an item (don't start editing)"), &listWidget); + item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable); + new QListWidgetItem(QLatin1String("try to type the letter 'c'"), &listWidget); + new QListWidgetItem(QLatin1String("completer"), &listWidget); + listWidget.show(); + listWidget.setCurrentItem(item); + QTest::qWaitForWindowShown(&listWidget); + + QTest::keyClick(listWidget.viewport(), Qt::Key_C); + + QLineEdit *le = qobject_cast<QLineEdit*>(listWidget.itemWidget(item)); + QVERIFY(le); + QCOMPARE(le->text(), QString("completer")); + QCOMPARE(le->completer()->currentCompletion(), QString("completer")); +} + + + QTEST_MAIN(tst_QListWidget) #include "tst_qlistwidget.moc" diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro index 6512e19..8117708 100644 --- a/tests/auto/qlocale/test/test.pro +++ b/tests/auto/qlocale/test/test.pro @@ -22,7 +22,7 @@ QT += network embedded: QT += gui wince*: { - addFiles.sources = \ + addFiles.files = \ ../syslocaleapp addFiles.path = "\\Program Files\\tst_qlocale" diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index 687aae2..f91fe58 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -28,19 +28,19 @@ CONFIG(debug_and_release) { } wince* { - additionalFiles.sources = ../lackey/lackey.exe + additionalFiles.files = ../lackey/lackey.exe additionalFiles.path = lackey } symbian { - additionalFiles.sources = lackey.exe + additionalFiles.files = lackey.exe additionalFiles.path = \\sys\\bin TARGET.UID3 = 0xE0340005 DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) } wince*|symbian { - scriptFiles.sources = ../lackey/scripts/*.js + scriptFiles.files = ../lackey/scripts/*.js scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro index 510a70e..6973955 100644 --- a/tests/auto/qmovie/qmovie.pro +++ b/tests/auto/qmovie/qmovie.pro @@ -7,19 +7,19 @@ MOC_DIR=tmp !contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG wince*: { - addFiles.sources = animations\\* + addFiles.files = animations\\* addFiles.path = animations DEPLOYMENT += addFiles } symbian: { - addFiles.sources = animations\\* + addFiles.files = animations\\* addFiles.path = animations DEPLOYMENT += addFiles qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 6e1b1e3..7efc2fb 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -16,17 +16,17 @@ QT = core network RESOURCES += ../qnetworkreply.qrc wince*: { - addFiles.sources = ../empty ../rfc3252.txt ../resource + addFiles.files = ../empty ../rfc3252.txt ../resource addFiles.path = . DEPLOYMENT += addFiles } symbian:{ - addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile + addFiles.files = ../empty ../rfc3252.txt ../resource ../bigfile addFiles.path = . DEPLOYMENT += addFiles - certFiles.sources = ../certs + certFiles.files = ../certs certFiles.path = . DEPLOYMENT += certFiles diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 1d6993a..5745e67 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -10,12 +10,12 @@ QT = core \ gui contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT wince*: { - addFiles.sources = signalbug.exe + addFiles.files = signalbug.exe addFiles.path = . DEPLOYMENT += addFiles } symbian: { - addFiles.sources = signalbug.exe + addFiles.files = signalbug.exe addFiles.path = \\sys\\bin DEPLOYMENT += addFiles } diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro index 69dc98d..ee624e1 100644 --- a/tests/auto/qpainter/qpainter.pro +++ b/tests/auto/qpainter/qpainter.pro @@ -2,7 +2,7 @@ load(qttest_p4) contains(QT_CONFIG, qt3support): QT += qt3support SOURCES += tst_qpainter.cpp wince*|symbian: { - addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png + addFiles.files = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif b/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif Binary files differnew file mode 100644 index 0000000..86a3a2e --- /dev/null +++ b/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index ff8258f..185ec1a 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -3,16 +3,16 @@ SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - task31722_0.sources = convertFromImage/task31722_0/*.png + task31722_0.files = convertFromImage/task31722_0/*.png task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/*.png + task31722_1.files = convertFromImage/task31722_1/*.png task31722_1.path = convertFromImage/task31722_1 - icons.sources = convertFromToHICON/* + icons.files = convertFromToHICON/* icons.path = convertFromToHICON - loadFromData.sources = loadFromData/* + loadFromData.files = loadFromData/* loadFromData.path = loadFromData DEPLOYMENT += task31722_0 task31722_1 icons loadFromData diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 8005ec5..fdf8311 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -179,6 +179,7 @@ private slots: void fromImageReader_data(); void fromImageReader(); + void fromImageReaderAnimatedGif_data(); void fromImageReaderAnimatedGif(); void preserveDepth(); @@ -1159,6 +1160,8 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() const int smallHeight = 20; const int largeWidth = 240; const int largeHeight = 320; + const int notAlignedWidth = 250; + const int notAlignedHeight = 250; // Indexed Color Formats - Disabled since images seem to be blank -> no palette? // QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black); @@ -1171,14 +1174,19 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() // Direct Color Formats QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor4K not aligned") << EColor4K << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green); QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green); + QTest::newRow("EColor64K not aligned") << EColor64K << notAlignedWidth << notAlignedHeight << QColor(Qt::green); QTest::newRow("EColor16M small") << EColor16M << smallWidth << smallHeight << QColor(Qt::yellow); QTest::newRow("EColor16M big") << EColor16M << largeWidth << largeHeight << QColor(Qt::yellow); + QTest::newRow("EColor16M not aligned") << EColor16M << notAlignedWidth << notAlignedHeight << QColor(Qt::yellow); QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor16MU not aligned") << EColor16MU << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0); QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0); + QTest::newRow("EColor16MA not aligned opaque") << EColor16MA << notAlignedWidth << notAlignedHeight << QColor(255, 255, 0); // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work // QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127); @@ -1236,6 +1244,10 @@ void tst_QPixmap::fromSymbianCFbsBitmap() QColor actualColor(image.pixel(1, 1)); QCOMPARE(actualColor, color); + + QImage shouldBe(pixmap.width(), pixmap.height(), image.format()); + shouldBe.fill(color.rgba()); + QCOMPARE(image, shouldBe); } __UHEAP_MARKEND; @@ -1605,6 +1617,8 @@ void tst_QPixmap::fromImageReader_data() QTest::newRow("designer_indexed8_no_alpha.gif") << prefix + "/designer_indexed8_no_alpha.gif"; QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif"; QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg"; + QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_with_alpha_animated.gif"; + QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; } void tst_QPixmap::fromImageReader() @@ -1621,14 +1635,22 @@ void tst_QPixmap::fromImageReader() QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap)); } +void tst_QPixmap::fromImageReaderAnimatedGif_data() +{ + QTest::addColumn<QString>("imagePath"); + QTest::newRow("gif with alpha") << QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif"); + QTest::newRow("gif without alpha") << QString::fromLatin1("/designer_indexed8_no_alpha_animated.gif"); +} + void tst_QPixmap::fromImageReaderAnimatedGif() { + QFETCH(QString, imagePath); #ifdef Q_OS_SYMBIAN const QString prefix = QLatin1String(SRCDIR) + "loadFromData"; #else const QString prefix = QLatin1String(SRCDIR) + "/loadFromData"; #endif - const QString path = prefix + QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif"); + const QString path = prefix + imagePath; QImageReader referenceReader(path); QImageReader pixmapReader(path); diff --git a/tests/auto/qpixmapfilter/qpixmapfilter.pro b/tests/auto/qpixmapfilter/qpixmapfilter.pro index e64d68d..964e56d 100644 --- a/tests/auto/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/qpixmapfilter/qpixmapfilter.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qpixmapfilter.cpp wince*: { - addFiles.sources = noise.png + addFiles.files = noise.png addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qplugin/tst_qplugin.pro b/tests/auto/qplugin/tst_qplugin.pro index 0d9d809..3629fb3 100644 --- a/tests/auto/qplugin/tst_qplugin.pro +++ b/tests/auto/qplugin/tst_qplugin.pro @@ -4,13 +4,13 @@ SOURCES = tst_qplugin.cpp QT = core wince*: { - plugins.sources = plugins/* + plugins.files = plugins/* plugins.path = plugins DEPLOYMENT += plugins } symbian: { - rpDep.sources = releaseplugin.dll debugplugin.dll + rpDep.files = releaseplugin.dll debugplugin.dll rpDep.path = plugins DEPLOYMENT += rpDep dpDep } diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro index e270120..be243b8 100644 --- a/tests/auto/qpluginloader/tst/tst.pro +++ b/tests/auto/qpluginloader/tst/tst.pro @@ -14,15 +14,15 @@ win32 { wince*: { - addFiles.sources = $$OUT_PWD/../bin/*.dll + addFiles.files = $$OUT_PWD/../bin/*.dll addFiles.path = bin DEPLOYMENT += addFiles } symbian: { - libDep.sources = tst_qpluginloaderlib.dll + libDep.files = tst_qpluginloaderlib.dll libDep.path = /sys/bin - pluginDep.sources = theplugin.dll + pluginDep.files = theplugin.dll pluginDep.path = bin DEPLOYMENT += libDep pluginDep diff --git a/tests/auto/qprocess/test/test.pro b/tests/auto/qprocess/test/test.pro index d555067..a91cadd 100644 --- a/tests/auto/qprocess/test/test.pro +++ b/tests/auto/qprocess/test/test.pro @@ -27,61 +27,61 @@ embedded: QT += gui wince*: { - addFile_fileWriterProcess.sources = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe + addFile_fileWriterProcess.files = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe addFile_fileWriterProcess.path = fileWriterProcess - addFile_testBatFiles.sources = $$PWD/../testBatFiles/* + addFile_testBatFiles.files = $$PWD/../testBatFiles/* addFile_testBatFiles.path = testBatFiles - addFile_testDetached.sources = $$OUT_PWD/../testDetached/testDetached.exe + addFile_testDetached.files = $$OUT_PWD/../testDetached/testDetached.exe addFile_testDetached.path = testDetached - addFile_testExitCodes.sources = $$OUT_PWD/../testExitCodes/testExitCodes.exe + addFile_testExitCodes.files = $$OUT_PWD/../testExitCodes/testExitCodes.exe addFile_testExitCodes.path = testExitCodes - addFile_testGuiProcess.sources = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe + addFile_testGuiProcess.files = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe addFile_testGuiProcess.path = testGuiProcess - addFile_testProcessCrash.sources = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe + addFile_testProcessCrash.files = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe addFile_testProcessCrash.path = testProcessCrash - addFile_testProcessDeadWhileReading.sources = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe + addFile_testProcessDeadWhileReading.files = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe addFile_testProcessDeadWhileReading.path = testProcessDeadWhileReading - addFile_testProcessEcho.sources = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe + addFile_testProcessEcho.files = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe addFile_testProcessEcho.path = testProcessEcho - addFile_testProcessEcho2.sources = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe + addFile_testProcessEcho2.files = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe addFile_testProcessEcho2.path = testProcessEcho2 - addFile_testProcessEcho3.sources = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe + addFile_testProcessEcho3.files = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe addFile_testProcessEcho3.path = testProcessEcho3 - addFile_testProcessEOF.sources = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe + addFile_testProcessEOF.files = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe addFile_testProcessEOF.path = testProcessEOF - addFile_testProcessLoopback.sources = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe + addFile_testProcessLoopback.files = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe addFile_testProcessLoopback.path = testProcessLoopback - addFile_testProcessNormal.sources = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe + addFile_testProcessNormal.files = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe addFile_testProcessNormal.path = testProcessNormal - addFile_testProcessOutput.sources = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe + addFile_testProcessOutput.files = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe addFile_testProcessOutput.path = testProcessOutput - addFile_testProcessNoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe + addFile_testProcessNoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe addFile_testProcessNoSpacesArgs.path = testProcessSpacesArgs - addFile_testProcessOneSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe + addFile_testProcessOneSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe addFile_testProcessOneSpacesArgs.path = testProcessSpacesArgs - addFile_testProcessTwoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe + addFile_testProcessTwoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe addFile_testProcessTwoSpacesArgs.path = testProcessSpacesArgs - addFile_testSoftExit.sources = $$OUT_PWD/../testSoftExit/testSoftExit.exe + addFile_testSoftExit.files = $$OUT_PWD/../testSoftExit/testSoftExit.exe addFile_testSoftExit.path = testSoftExit - addFile_testSpaceInName.sources = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe + addFile_testSpaceInName.files = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe addFile_testSpaceInName.path = "test Space In Name" @@ -108,7 +108,7 @@ wince*: { } symbian: { - binDep.sources = \ + binDep.files = \ fileWriterProcess.exe \ testDetached.exe \ testExitCodes.exe \ diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index 17e36af..6bdeb1e 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -21,22 +21,22 @@ PRE_TARGETDEPS += $${runtime_resource.target} QT = core wince*|symbian:{ - deploy.sources += runtime_resource.rcc parentdir.txt - test.sources = testqrc/* + deploy.files += runtime_resource.rcc parentdir.txt + test.files = testqrc/* test.path = testqrc - alias.sources = testqrc/aliasdir/* + alias.files = testqrc/aliasdir/* alias.path = testqrc/aliasdir - other.sources = testqrc/otherdir/* + other.files = testqrc/otherdir/* other.path = testqrc/otherdir - search1.sources = testqrc/searchpath1/* + search1.files = testqrc/searchpath1/* search1.path = testqrc/searchpath1 - search2.sources = testqrc/searchpath2/* + search2.files = testqrc/searchpath2/* search2.path = testqrc/searchpath2 - sub.sources = testqrc/subdir/* + sub.files = testqrc/subdir/* sub.path = testqrc/subdir - testsub.sources = testqrc/test/* + testsub.files = testqrc/test/* testsub.path = testqrc/test - testsub2.sources = testqrc/test/test/* + testsub2.files = testqrc/test/test/* testsub2.path = testqrc/test/test DEPLOYMENT = deploy test alias other search1 search2 sub testsub testsub2 !symbian:DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index fc35f66..c5c2861 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -10,7 +10,7 @@ wince* { } wince*|symbian: { - addFiles.sources = script + addFiles.files = script addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro index 07a4672..b1ddd64 100644 --- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro +++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro @@ -5,7 +5,7 @@ SOURCES += tst_qscriptjstestsuite.cpp !symbian: DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian: { -testFiles.sources = tests +testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 03e26bd..5d8e5af4 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -4,7 +4,7 @@ SOURCES += tst_qscriptv8testsuite.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian: { -testFiles.sources = tests +testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 2b62ccc..bc6ba77 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -144,6 +144,7 @@ private slots: void testMultipleProxiesWithSelection(); void mapSelectionFromSource(); + void testResetInternalData(); protected: void buildHierarchy(const QStringList &data, QAbstractItemModel *model); @@ -3176,5 +3177,142 @@ void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation() // No assert failure, it passes. } +/** + * A proxy which changes the background color for items ending in 'y' or 'r' + */ +class CustomDataProxy : public QSortFilterProxyModel +{ + Q_OBJECT + +public: + CustomDataProxy(QObject *parent = 0) + : QSortFilterProxyModel(parent) + { + setDynamicSortFilter(true); + } + + void setSourceModel(QAbstractItemModel *sourceModel) + { + // It would be possible to use only the modelReset signal of the source model to clear + // the data in *this, however, this requires that the slot is connected + // before QSortFilterProxyModel::setSourceModel is called, and even then depends + // on the order of invokation of slots being the same as the order of connection. + // ie, not reliable. +// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData())); + QSortFilterProxyModel::setSourceModel(sourceModel); + // Making the connect after the setSourceModel call clears the data too late. +// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData())); + + // This could be done in data(), but the point is to need to cache something in the proxy + // which needs to be cleared on reset. + for (int i = 0; i < sourceModel->rowCount(); ++i) + { + if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('y'))) + { + m_backgroundColours.insert(i, Qt::blue); + } else if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('r'))) + { + m_backgroundColours.insert(i, Qt::red); + } + } + } + + QVariant data(const QModelIndex &index, int role) const + { + if (role != Qt::BackgroundRole) + return QSortFilterProxyModel::data(index, role); + return m_backgroundColours.value(index.row()); + } + +private slots: + void resetInternalData() + { + m_backgroundColours.clear(); + } + +private: + QHash<int, QColor> m_backgroundColours; +}; + +class ModelObserver : public QObject +{ + Q_OBJECT +public: + ModelObserver(QAbstractItemModel *model, QObject *parent = 0) + : QObject(parent), m_model(model) + { + connect(m_model, SIGNAL(modelAboutToBeReset()), SLOT(modelAboutToBeReset())); + connect(m_model, SIGNAL(modelReset()), SLOT(modelReset())); + } + +public slots: + void modelAboutToBeReset() + { + int reds = 0, blues = 0; + for (int i = 0; i < m_model->rowCount(); ++i) + { + QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value<QColor>(); + if (color == Qt::blue) + ++blues; + if (color == Qt::red) + ++reds; + } + QCOMPARE(blues, 11); + QCOMPARE(reds, 4); + } + + void modelReset() + { + int reds = 0, blues = 0; + for (int i = 0; i < m_model->rowCount(); ++i) + { + QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value<QColor>(); + if (color == Qt::blue) + ++blues; + if (color == Qt::red) + ++reds; + } + QCOMPARE(reds, 0); + QCOMPARE(blues, 0); + } + +private: + QAbstractItemModel * const m_model; + +}; + +void tst_QSortFilterProxyModel::testResetInternalData() +{ + + QStringListModel model(QStringList() << "Monday" + << "Tuesday" + << "Wednesday" + << "Thursday" + << "Friday" + << "January" + << "February" + << "March" + << "April" + << "May" + << "Saturday" + << "June" + << "Sunday" + << "July" + << "August" + << "September" + << "October" + << "November" + << "December"); + + CustomDataProxy proxy; + proxy.setSourceModel(&model); + + ModelObserver observer(&proxy); + + // Cause the source model to reset. + model.setStringList(QStringList() << "Spam" << "Eggs"); + +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro index bb1981c..a1760f8 100644 --- a/tests/auto/qsound/qsound.pro +++ b/tests/auto/qsound/qsound.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qsound.cpp wince*|symbian: { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy !symbian:DEFINES += SRCDIR=\\\"\\\" } else { diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro index b11e408..5422fae 100644 --- a/tests/auto/qsplitter/qsplitter.pro +++ b/tests/auto/qsplitter/qsplitter.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsplitter.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = extradata.txt setSizes3.dat + addFiles.files = extradata.txt setSizes3.dat addFiles.path = . DEPLOYMENT += addFiles !symbian:DEFINES += SRCDIR=\\\"./\\\" diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 0ec581d..9bf30f8 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -13,7 +13,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro index 6381219..066c24f 100644 --- a/tests/auto/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/qsqldatabase/qsqldatabase.pro @@ -13,7 +13,7 @@ win32: { wince*: { DEPLOYMENT_PLUGIN += qsqlite - testData.sources = testdata + testData.files = testdata testData.path = . DEPLOYMENT += testData @@ -26,7 +26,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index 2e9ed67..c02d74a 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqldriver.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -20,7 +20,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro index 456f585..ebf6d24 100644 --- a/tests/auto/qsqlerror/qsqlerror.pro +++ b/tests/auto/qsqlerror/qsqlerror.pro @@ -11,7 +11,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro index 7339854..2359151 100644 --- a/tests/auto/qsqlfield/qsqlfield.pro +++ b/tests/auto/qsqlfield/qsqlfield.pro @@ -7,7 +7,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro index 97646ed..fbcc998 100644 --- a/tests/auto/qsqlquery/qsqlquery.pro +++ b/tests/auto/qsqlquery/qsqlquery.pro @@ -8,7 +8,7 @@ QT = core sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -18,7 +18,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro index cda8cab..4b23e94 100644 --- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro @@ -10,7 +10,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro index f36f076..16e3ae4 100644 --- a/tests/auto/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/qsqlrecord/qsqlrecord.pro @@ -5,7 +5,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index c6681d5..dad42d5 100644 --- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqlrelationaltablemodel.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -12,7 +12,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro index 9a23237..e49020f 100644 --- a/tests/auto/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqltablemodel.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -12,7 +12,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro index 5522232..2e4c72a 100644 --- a/tests/auto/qsqlthread/qsqlthread.pro +++ b/tests/auto/qsqlthread/qsqlthread.pro @@ -5,7 +5,7 @@ QT = core sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -13,7 +13,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro index d7671ea..e21587b 100644 --- a/tests/auto/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/qsslcertificate/qsslcertificate.pro @@ -15,7 +15,7 @@ win32 { } wince*|symbian: { - certFiles.sources = certificates more-certificates + certFiles.files = certificates more-certificates certFiles.path = . DEPLOYMENT += certFiles } diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro index dff0db1..5a90b76 100644 --- a/tests/auto/qsslkey/qsslkey.pro +++ b/tests/auto/qsslkey/qsslkey.pro @@ -15,10 +15,10 @@ win32 { } wince*|symbian: { - keyFiles.sources = keys + keyFiles.files = keys keyFiles.path = . - passphraseFiles.sources = rsa-without-passphrase.pem rsa-with-passphrase.pem + passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem passphraseFiles.path = . DEPLOYMENT += keyFiles passphraseFiles diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index accfa89..aeeae8f 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -18,7 +18,7 @@ win32 { wince* { DEFINES += SRCDIR=\\\"./\\\" - certFiles.sources = certs ssl.tar.gz + certFiles.files = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles } else:symbian { @@ -26,7 +26,7 @@ wince* { TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY=NetworkServices - certFiles.sources = certs ssl.tar.gz + certFiles.files = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro index 11f5943..eb198e2 100644 --- a/tests/auto/qstyle/qstyle.pro +++ b/tests/auto/qstyle/qstyle.pro @@ -4,7 +4,7 @@ SOURCES += tst_qstyle.cpp wince*|symbian: { !symbian:DEFINES += SRCDIR=\\\".\\\" - addPixmap.sources = task_25863.png + addPixmap.files = task_25863.png addPixmap.path = . DEPLOYMENT += addPixmap } else { diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index a76c82d..ba24225 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -53,6 +53,7 @@ #include <qscrollbar.h> #include <qprogressbar.h> #include <qtoolbutton.h> +#include <qtoolbar.h> #include <qplastiquestyle.h> #include <qwindowsstyle.h> @@ -146,6 +147,7 @@ private slots: void pixelMetric(); void progressBarChangeStyle(); void defaultFont(); + void testDrawingShortcuts(); private: void lineUpLayoutTest(QStyle *); QWidget *testWidget; @@ -781,5 +783,54 @@ void tst_QStyle::defaultFont() qApp->setFont(defaultFont); } +class DrawTextStyle : public QProxyStyle +{ + Q_OBJECT +public: + DrawTextStyle(QStyle *base = 0) : QProxyStyle(), alignment(0) { setBaseStyle(base); } + void drawItemText(QPainter *painter, const QRect &rect, + int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const + { + DrawTextStyle *that = (DrawTextStyle *)this; + that->alignment = flags; + QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } + int alignment; +}; + +void tst_QStyle::testDrawingShortcuts() +{ + { + QWidget w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } + { + QToolBar w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.addWidget(tb); + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } +} + QTEST_MAIN(tst_QStyle) #include "tst_qstyle.moc" diff --git a/tests/auto/qsvggenerator/qsvggenerator.pro b/tests/auto/qsvggenerator/qsvggenerator.pro index 1ccf8e9..2e899a9 100644 --- a/tests/auto/qsvggenerator/qsvggenerator.pro +++ b/tests/auto/qsvggenerator/qsvggenerator.pro @@ -8,7 +8,7 @@ QT += svg xml SOURCES += tst_qsvggenerator.cpp wince*|symbian { - addFiles.sources = referenceSvgs + addFiles.files = referenceSvgs addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qsvgrenderer/qsvgrenderer.pro b/tests/auto/qsvgrenderer/qsvgrenderer.pro index 0b785e3..49337e2 100644 --- a/tests/auto/qsvgrenderer/qsvgrenderer.pro +++ b/tests/auto/qsvgrenderer/qsvgrenderer.pro @@ -9,7 +9,7 @@ SOURCES += tst_qsvgrenderer.cpp RESOURCES += resources.qrc wince*|symbian { - addFiles.sources = *.svg *.svgz + addFiles.files = *.svg *.svgz addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qtcpserver/test/test.pro b/tests/auto/qtcpserver/test/test.pro index 123c79e..e91ba20 100644 --- a/tests/auto/qtcpserver/test/test.pro +++ b/tests/auto/qtcpserver/test/test.pro @@ -4,7 +4,7 @@ SOURCES += ../tst_qtcpserver.cpp win32: { wince*: { LIBS += -lws2 - crashApp.sources = ../crashingServer/crashingServer.exe + crashApp.files = ../crashingServer/crashingServer.exe crashApp.path = crashingServer DEPLOYMENT += crashApp } else { @@ -13,7 +13,7 @@ wince*: { } symbian { - crashApp.sources = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe + crashApp.files = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe crashApp.path = . DEPLOYMENT += crashApp } diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index b2151b9..ab2a32d 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -105,6 +105,8 @@ private slots: void invalidProxy(); void proxyFactory_data(); void proxyFactory(); + + void qtbug14268_peek(); }; // Testing get/set functions @@ -662,5 +664,56 @@ void tst_QTcpServer::proxyFactory() QTEST(int(server.serverError()), "expectedError"); } +class Qtbug14268Helper : public QObject +{ + Q_OBJECT +public: + QByteArray lastDataPeeked; +public slots: + void newConnection() { + QTcpServer* server=static_cast<QTcpServer*>(sender()); + QTcpSocket* s=server->nextPendingConnection(); + connect(s,SIGNAL(readyRead()),this,SLOT(onServerReadyRead())); + } + void onServerReadyRead() { + QTcpSocket* clientSocket=static_cast<QTcpSocket*>(sender()); + lastDataPeeked = clientSocket->peek(128*1024).toHex(); + QTestEventLoop::instance().exitLoop(); + } +}; + +// there is a similar test inside tst_qtcpsocket that uses the waitFor* functions instead +void tst_QTcpServer::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + QTcpServer server; + server.listen(); + + Qtbug14268Helper helper; + QObject::connect(&server, SIGNAL(newConnection()), &helper, SLOT(newConnection())); + + QTcpSocket client; + client.connectToHost(QHostAddress::LocalHost, server.serverPort()); + QVERIFY(client.waitForConnected(2000)); + + client.write("abc\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a")); + + client.write("def\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a")); + + client.write("ghi\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a6768690a")); +} + QTEST_MAIN(tst_QTcpServer) #include "tst_qtcpserver.moc" diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 31cae40..2dbe5b7 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -201,6 +201,9 @@ private slots: void proxyFactory_data(); void proxyFactory(); + void qtbug14268_peek(); + + protected slots: void nonBlockingIMAP_hostFound(); void nonBlockingIMAP_connected(); @@ -251,6 +254,41 @@ enum ProxyTests { int tst_QTcpSocket::loopLevel = 0; +class SocketPair: public QObject +{ + Q_OBJECT +public: + QTcpSocket *endPoints[2]; + + SocketPair(QObject *parent = 0) + : QObject(parent) + { + endPoints[0] = endPoints[1] = 0; + } + + bool create() + { + QTcpServer server; + server.listen(); + + QTcpSocket *active = new QTcpSocket(this); + active->connectToHost("127.0.0.1", server.serverPort()); + + if (!active->waitForConnected(1000)) + return false; + + if (!server.waitForNewConnection(1000)) + return false; + + QTcpSocket *passive = server.nextPendingConnection(); + passive->setParent(this); + + endPoints[0] = active; + endPoints[1] = passive; + return true; + } +}; + tst_QTcpSocket::tst_QTcpSocket() { Q_SET_DEFAULT_IAP @@ -2467,6 +2505,40 @@ void tst_QTcpSocket::proxyFactory() delete socket; } +// there is a similar test inside tst_qtcpserver that uses the event loop instead +void tst_QTcpSocket::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + SocketPair socketPair; + QVERIFY(socketPair.create()); + QTcpSocket *outgoing = socketPair.endPoints[0]; + QTcpSocket *incoming = socketPair.endPoints[1]; + + QVERIFY(incoming->state() == QTcpSocket::ConnectedState); + QVERIFY(outgoing->state() == QTcpSocket::ConnectedState); + + outgoing->write("abc\n"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\n")); + + outgoing->write("def\n"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\n")); + + outgoing->write("ghi\n"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\nghi\n")); + + QVERIFY(incoming->read(128*1024) == QByteArray("abc\ndef\nghi\n")); +} + + QTEST_MAIN(tst_QTcpSocket) #include "tst_qtcpsocket.moc" diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index c93a2e5..543c143 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -4,7 +4,7 @@ QT = core symbian { - testData.sources = tst_qtemporaryfile.cpp + testData.files = tst_qtemporaryfile.cpp testData.path = . DEPLOYMENT += testData }else { diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro index aa1fbb5..e8fb9cb 100644 --- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro +++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro @@ -5,7 +5,7 @@ SOURCES += tst_qtextboundaryfinder.cpp !symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian:{ - addFiles.sources = data + addFiles.files = data addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro index 88061a9..773fb97 100644 --- a/tests/auto/qtextbrowser/qtextbrowser.pro +++ b/tests/auto/qtextbrowser/qtextbrowser.pro @@ -6,9 +6,9 @@ contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = *.html + addFiles.files = *.html addFiles.path = . - addDir.sources = subdir/* + addDir.files = subdir/* addDir.path = subdir DEPLOYMENT += addFiles addDir } diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro index b85032a..2188d2f 100644 --- a/tests/auto/qtextcodec/test/test.pro +++ b/tests/auto/qtextcodec/test/test.pro @@ -17,7 +17,7 @@ win32: { } wince*|symbian { - addFiles.sources = ../*.txt + addFiles.files = ../*.txt addFiles.path = . DEPLOYMENT += addFiles wince*|qt_not_deployed { diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro index 43813da..e7d6c03 100644 --- a/tests/auto/qtextedit/qtextedit.pro +++ b/tests/auto/qtextedit/qtextedit.pro @@ -6,7 +6,7 @@ HEADERS += SOURCES += tst_qtextedit.cpp wince*|symbian: { - addImages.sources = fullWidthSelection/* + addImages.files = fullWidthSelection/* addImages.path = fullWidthSelection DEPLOYMENT += addImages } diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro index 20823de..8805fb9 100644 --- a/tests/auto/qtextstream/test/test.pro +++ b/tests/auto/qtextstream/test/test.pro @@ -18,9 +18,9 @@ QT = core network wince*|symbian: { - addFiles.sources = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp + addFiles.files = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp addFiles.path = . - res.sources = ../resources + res.files = ../resources res.path = . DEPLOYMENT += addFiles } @@ -30,7 +30,7 @@ wince*: { }else:symbian { # Symbian can't define SRCDIR meaningfully here qt_not_deployed { - codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll + codecs_plugins.files = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs DEPLOYMENT += codecs_plugins } diff --git a/tests/auto/qthreadstorage/crashOnExit.cpp b/tests/auto/qthreadstorage/crashOnExit.cpp new file mode 100644 index 0000000..96515a0 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 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$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtCore/QtCore> + +class Class +{ +public: + ~Class() + { + // trigger creation of a new QThreadStorage, after the previous QThreadStorage from main() was destructed + static QThreadStorage<int *> threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); + } +}; + +int main() +{ + // instantiate the class that will use QThreadStorage from its destructor, it's destructor will be run last + static Class instance; + // instantiate QThreadStorage, it's destructor (and the global destructors for QThreadStorages internals) will run first + static QThreadStorage<int *> threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); +} diff --git a/tests/auto/qthreadstorage/crashOnExit.pro b/tests/auto/qthreadstorage/crashOnExit.pro new file mode 100644 index 0000000..918ef39 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.pro @@ -0,0 +1,4 @@ +SOURCES += crashOnExit.cpp +QT = core +CONFIG-=app_bundle +CONFIG+=console diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro index 3071098..a06f89c 100644 --- a/tests/auto/qthreadstorage/qthreadstorage.pro +++ b/tests/auto/qthreadstorage/qthreadstorage.pro @@ -1,4 +1,4 @@ -load(qttest_p4) -SOURCES += tst_qthreadstorage.cpp -QT = core -symbian:LIBS += -llibpthread +TEMPLATE = subdirs +SUBDIRS = \ + tst_qthreadstorage.pro \ + crashOnExit.pro diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index d8b404f..ed86165 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -76,6 +76,7 @@ private slots: void autoDelete(); void adoptedThreads(); void ensureCleanupOrder(); + void QTBUG13877_crashOnExit(); }; class Pointer @@ -293,5 +294,21 @@ void tst_QThreadStorage::ensureCleanupOrder() QVERIFY(First::order < Second::order); } +void tst_QThreadStorage::QTBUG13877_crashOnExit() +{ + QProcess process; +#ifdef Q_OS_WIN +# ifdef QT_NO_DEBUG + process.start("release/crashOnExit"); +# else + process.start("debug/crashOnExit"); +# endif +#else + process.start("./crashOnExit"); +#endif + QVERIFY(process.waitForFinished()); + QVERIFY(process.exitStatus() != QProcess::CrashExit); +} + QTEST_MAIN(tst_QThreadStorage) #include "tst_qthreadstorage.moc" diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.pro b/tests/auto/qthreadstorage/tst_qthreadstorage.pro new file mode 100644 index 0000000..3071098 --- /dev/null +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.pro @@ -0,0 +1,4 @@ +load(qttest_p4) +SOURCES += tst_qthreadstorage.cpp +QT = core +symbian:LIBS += -llibpthread diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro index 68a5362..50c2669 100644 --- a/tests/auto/qtipc/qsharedmemory/test/test.pro +++ b/tests/auto/qtipc/qsharedmemory/test/test.pro @@ -20,16 +20,16 @@ TARGET = ../tst_qsharedmemory wince*:{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts +addFiles.files = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\".\\\" }else:symbian{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../../lackey/scripts +addFiles.files = ../../lackey/scripts addFiles.path = /data/qsharedmemorytemp/lackey -addBin.sources = lackey.exe +addBin.files = lackey.exe addBin.path = /sys/bin DEPLOYMENT += addFiles addBin } else { diff --git a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro index 8a5f8b2..bb319ee 100644 --- a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro +++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro @@ -17,7 +17,7 @@ requires(contains(QT_CONFIG,script)) # this test calls lackey, which then again depends on QtScript. # let's add it here so that it gets deployed easily QT += script -lackey.sources = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts +lackey.files = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts lackey.path = . DEPLOYMENT += lackey } @@ -28,7 +28,7 @@ requires(contains(QT_CONFIG,script)) # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../lackey/lackey.exe +lackey.files = ../lackey/lackey.exe lackey.path = /sys/bin DEPLOYMENT += lackey } diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro index 5b742f7..0001d1c 100644 --- a/tests/auto/qtranslator/qtranslator.pro +++ b/tests/auto/qtranslator/qtranslator.pro @@ -3,7 +3,7 @@ SOURCES += tst_qtranslator.cpp RESOURCES += qtranslator.qrc wince*|symbian: { - addFiles.sources = hellotr_la.qm msgfmt_from_po.qm + addFiles.files = hellotr_la.qm msgfmt_from_po.qm addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro index 9c0d009..7e5ffe4 100644 --- a/tests/auto/qudpsocket/test/test.pro +++ b/tests/auto/qudpsocket/test/test.pro @@ -15,7 +15,7 @@ win32 { } wince*|symbian: { - addApp.sources = ../clientserver/clientserver.exe + addApp.files = ../clientserver/clientserver.exe addApp.path = clientserver DEPLOYMENT += addApp } diff --git a/tests/auto/quuid/test/test.pro b/tests/auto/quuid/test/test.pro index 123aa50..06ae3bd 100644 --- a/tests/auto/quuid/test/test.pro +++ b/tests/auto/quuid/test/test.pro @@ -15,14 +15,14 @@ CONFIG(debug_and_release_target) { } wince* { - addFile_processUniqueness.sources = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe + addFile_processUniqueness.files = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe addFile_processUniqueness.path = testProcessUniqueness DEPLOYMENT += addFile_processUniqueness } symbian { - binDep.sources = testProcessUniqueness.exe + binDep.files = testProcessUniqueness.exe binDep.path = \\sys\\bin DEPLOYMENT += binDep diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro index 5fb7fe2..c87518a 100644 --- a/tests/auto/qxml/qxml.pro +++ b/tests/auto/qxml/qxml.pro @@ -4,7 +4,7 @@ SOURCES += tst_qxml.cpp QT = core xml wince*|symbian: { - addFiles.sources = 0x010D.xml + addFiles.files = 0x010D.xml addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro index 339fa55..bcab0b4 100644 --- a/tests/auto/qxmlformatter/qxmlformatter.pro +++ b/tests/auto/qxmlformatter/qxmlformatter.pro @@ -4,7 +4,7 @@ SOURCES += tst_qxmlformatter.cpp include (../xmlpatterns.pri) wince*|symbian:{ - addFiles.sources = baselines input + addFiles.files = baselines input addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro index 044b7ce..d5e8228 100644 --- a/tests/auto/qxmlquery/qxmlquery.pro +++ b/tests/auto/qxmlquery/qxmlquery.pro @@ -19,10 +19,10 @@ wince* { include (../xmlpatterns.pri) wince*|symbian: { - addFiles.sources = pushBaselines input.xml + addFiles.files = pushBaselines input.xml addFiles.path = . - patternistFiles.sources = ../xmlpatterns/queries + patternistFiles.files = ../xmlpatterns/queries symbian: { #../xmlpatterns resolves to an illegal path for deployment patternistFiles.path = xmlpatterns diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 2187aeb..b7c8740 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -455,6 +455,7 @@ void tst_QXmlQuery::assignmentOperator() const class ReturnURI : public QAbstractUriResolver { public: + ReturnURI() {} virtual QUrl resolve(const QUrl &relative, const QUrl &baseURI) const { @@ -2858,6 +2859,7 @@ void tst_QXmlQuery::useUriResolver() const , private TestFundament { public: + TestUriResolver() {} virtual QUrl resolve(const QUrl &relative, const QUrl &baseURI) const { diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro index c107470..bc3cbd2 100644 --- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro +++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro @@ -13,7 +13,7 @@ QT -= gui wince*|symbian: { - addFiles.sources = encodings parser xmldocs + addFiles.files = encodings parser xmldocs addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro index 8f076be..31d77e7 100644 --- a/tests/auto/qxmlstream/qxmlstream.pro +++ b/tests/auto/qxmlstream/qxmlstream.pro @@ -5,7 +5,7 @@ QT = core xml network wince*|symbian: { - addFiles.sources = data XML-Test-Suite + addFiles.files = data XML-Test-Suite addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qzip/qzip.pro b/tests/auto/qzip/qzip.pro index 632c743..683da62 100644 --- a/tests/auto/qzip/qzip.pro +++ b/tests/auto/qzip/qzip.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qzip.cpp wince*|symbian: { - addFiles.sources = testdata + addFiles.files = testdata addFiles.path = . DEPLOYMENT += addFiles !symbian:DEFINES += SRCDIR=\\\".\\\" diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro index d99df00..4e95956 100644 --- a/tests/auto/uiloader/uiloader/uiloader.pro +++ b/tests/auto/uiloader/uiloader/uiloader.pro @@ -17,10 +17,10 @@ QT += xml svg network contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - configuration.sources = ../*.ini + configuration.files = ../*.ini configuration.path = . - screenapp.sources = ../tst_screenshot/tst_screenshot.exe + screenapp.files = ../tst_screenshot/tst_screenshot.exe screenapp.path = tst_screenshot DEPLOYMENT += configuration screenapp diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro index f3124a3..b0536a5 100644 --- a/tests/auto/windowsmobile/test/test.pro +++ b/tests/auto/windowsmobile/test/test.pro @@ -8,7 +8,7 @@ RESOURCES += windowsmobile.qrc TARGET = ../tst_windowsmobile wincewm*: { - addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe + addFiles.files = $$OUT_PWD/../testQMenuBar/*.exe addFiles.path = "\\Program Files\\tst_windowsmobile" diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri index 8c8ccad..57b8517 100644 --- a/tests/auto/xmlpatterns.pri +++ b/tests/auto/xmlpatterns.pri @@ -4,9 +4,9 @@ contains(QT_CONFIG,xmlpatterns) { } wince*: { - patternsdk.sources = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll + patternsdk.files = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll patternsdk.path = . - basedata.sources = xmlpaternsxqts/Baseline.xml + basedata.files = xmlpaternsxqts/Baseline.xml basedata.path = . DEPLOYMENT += patternsdk QT += network diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro index 981adab..3e252f6 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro @@ -21,7 +21,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ ../xmlpatternssdk wince*|symbian { - catalog.sources = TestSuite Baseline.xml + catalog.files = TestSuite Baseline.xml catalog.path = . DEPLOYMENT += catalog } diff --git a/tests/auto/xmlpatternsview/xmlpatternsview.pro b/tests/auto/xmlpatternsview/xmlpatternsview.pro index d93cba3..5ab0f0e 100644 --- a/tests/auto/xmlpatternsview/xmlpatternsview.pro +++ b/tests/auto/xmlpatternsview/xmlpatternsview.pro @@ -6,7 +6,7 @@ include (../xmlpatterns.pri) TARGET = tst_xmlpatternsview wince*: { - viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe + viewexe.files = $$QT_BUILD_TREE/xmlpatternsview.exe viewexe.path = . DEPLOYMENT += viewexe } diff --git a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro index 940cc31..44c4754 100644 --- a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro +++ b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro @@ -18,7 +18,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ ../xmlpatternssdk wince*: { - testdata.sources = XSLTS Baseline.xml + testdata.files = XSLTS Baseline.xml testdata.path = . DEPLOYMENT += testdata } diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro index 23f0e00..f26d623 100644 --- a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro +++ b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp wince*:{ DEFINES += SRCDIR=\\\"\\\" } else:symbian* { - addFiles.sources = utf-8.txt + addFiles.files = utf-8.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/benchmarks/corelib/corelib.pro b/tests/benchmarks/corelib/corelib.pro index 7669e0a..8a6941b 100644 --- a/tests/benchmarks/corelib/corelib.pro +++ b/tests/benchmarks/corelib/corelib.pro @@ -4,4 +4,5 @@ SUBDIRS = \ kernel \ thread \ tools \ - codecs + codecs \ + plugin diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro index 320746c..17d164d 100755 --- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro @@ -16,7 +16,7 @@ SOURCES += qfilesystemiterator.cpp HEADERS += qfilesystemiterator.h wince*|symbian: { - corelibdir.sources = $$QT_SOURCE_TREE/src/corelib + corelibdir.files = $$QT_SOURCE_TREE/src/corelib corelibdir.path = ./depot/src DEPLOYMENT += corelibdir } diff --git a/tests/benchmarks/corelib/plugin/plugin.pro b/tests/benchmarks/corelib/plugin/plugin.pro new file mode 100644 index 0000000..2afd7f3 --- /dev/null +++ b/tests/benchmarks/corelib/plugin/plugin.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = quuid diff --git a/tests/benchmarks/corelib/plugin/quuid/quuid.pro b/tests/benchmarks/corelib/plugin/quuid/quuid.pro new file mode 100644 index 0000000..4e502fc --- /dev/null +++ b/tests/benchmarks/corelib/plugin/quuid/quuid.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_bench_quuid + +SOURCES += tst_quuid.cpp +QT -= gui diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp new file mode 100644 index 0000000..e9d4b44 --- /dev/null +++ b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2010 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$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtCore/QCoreApplication> +#include <QtCore/QUuid> +#include <QtTest/QtTest> + +class tst_bench_QUuid : public QObject +{ + Q_OBJECT + +public: + tst_bench_QUuid() + { } + +private slots: + void createUuid(); +}; + +void tst_bench_QUuid::createUuid() +{ + QBENCHMARK { + QUuid::createUuid(); + } +} + +QTEST_MAIN(tst_bench_QUuid); +#include "tst_quuid.moc" diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro index e8720e1..e43e400 100644 --- a/tests/benchmarks/corelib/tools/qstring/qstring.pro +++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp data.cpp wince*:{ DEFINES += SRCDIR=\\\"\\\" } else:symbian* { - addFiles.sources = utf-8.txt + addFiles.files = utf-8.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro index c1a8223..ceaabeb 100644 --- a/tests/benchmarks/declarative/binding/binding.pro +++ b/tests/benchmarks/declarative/binding/binding.pro @@ -8,7 +8,7 @@ SOURCES += tst_binding.cpp testtypes.cpp HEADERS += testtypes.h symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT = data } else { diff --git a/tests/benchmarks/declarative/compilation/compilation.pro b/tests/benchmarks/declarative/compilation/compilation.pro index 9277187..9ab2a25 100644 --- a/tests/benchmarks/declarative/compilation/compilation.pro +++ b/tests/benchmarks/declarative/compilation/compilation.pro @@ -9,7 +9,7 @@ CONFIG += release SOURCES += tst_compilation.cpp symbian { - data.sources += data + data.files += data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro index 6540fa2..74cb47f 100644 --- a/tests/benchmarks/declarative/creation/creation.pro +++ b/tests/benchmarks/declarative/creation/creation.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_creation.cpp symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro index b2f39c1..4693a82 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro +++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp HEADERS += testtypes.h symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro index a68792b..c4d5609 100644 --- a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro +++ b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -8,7 +8,7 @@ CONFIG += release SOURCES += tst_qdeclarativeimage.cpp symbian { - importFiles.sources = image.png + importFiles.files = image.png importFiles.path = DEPLOYMENT = importFiles } else { diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro index 65ee7e0..765e37a 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativemetaproperty.cpp symbian { - data.sources += data + data.files += data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qmltime/qmltime.pro b/tests/benchmarks/declarative/qmltime/qmltime.pro index 6f5ad5e..273a60a 100644 --- a/tests/benchmarks/declarative/qmltime/qmltime.pro +++ b/tests/benchmarks/declarative/qmltime/qmltime.pro @@ -8,7 +8,7 @@ SOURCES += qmltime.cpp symbian { TARGET.CAPABILITY = "All -TCB" - example.sources = example.qml tests + example.files = example.qml tests example.path = . DEPLOYMENT += example } diff --git a/tests/benchmarks/declarative/script/script.pro b/tests/benchmarks/declarative/script/script.pro index 685ba03..d6cb708 100644 --- a/tests/benchmarks/declarative/script/script.pro +++ b/tests/benchmarks/declarative/script/script.pro @@ -8,7 +8,7 @@ CONFIG += release SOURCES += tst_script.cpp symbian { - importFiles.sources = data + importFiles.files = data importFiles.path = DEPLOYMENT = importFiles } else { diff --git a/tests/benchmarks/declarative/typeimports/typeimports.pro b/tests/benchmarks/declarative/typeimports/typeimports.pro index a5df3f0..56834e6 100644 --- a/tests/benchmarks/declarative/typeimports/typeimports.pro +++ b/tests/benchmarks/declarative/typeimports/typeimports.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_typeimports.cpp symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro index 6e044f9..bfa374c 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro @@ -9,7 +9,7 @@ include(chiptester/chiptester.pri) symbian { qt_not_deployed { - plugins.sources = qjpeg.dll + plugins.files = qjpeg.dll plugins.path = imageformats DEPLOYMENT += plugins } diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro index d67f4be..db5ffcd 100644 --- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro +++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro @@ -11,15 +11,15 @@ SOURCES += tst_qimagereader.cpp QT += network wince*: { - addFiles.sources = images + addFiles.files = images addFiles.path = . CONFIG(debug, debug|release):{ - imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*d4.dll + imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*d4.dll } CONFIG(release, debug|release):{ - imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*[^d]4.dll + imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*[^d]4.dll } imageFormatsPlugins.path = imageformats DEPLOYMENT += addFiles imageFormatsPlugins diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro index a1b6a22..1c18302 100644 --- a/tests/benchmarks/gui/text/qtext/qtext.pro +++ b/tests/benchmarks/gui/text/qtext/qtext.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp symbian* { TARGET.CAPABILITY = ALL -TCB - addFiles.sources = bidi.txt + addFiles.files = bidi.txt addFiles.path = . DEPLOYMENT += addFiles } else { diff --git a/tests/manual/mkspecs/.gitignore b/tests/manual/mkspecs/.gitignore new file mode 100644 index 0000000..403e028 --- /dev/null +++ b/tests/manual/mkspecs/.gitignore @@ -0,0 +1,2 @@ +tmp +specs diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh new file mode 100755 index 0000000..4b723c0 --- /dev/null +++ b/tests/manual/mkspecs/test.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +if [ "$1" == "--help" ]; then + echo "Init a clean git repository somewhere and run this test script from that directory. The first run will" + echo "produce a bunch of specs. This is your baseline. Run 'git add specs' and commit the baseline. Then run" + echo "this script again, after making changes to the mkspecs. You should see any diffs you produced." + exit 0 +fi + + +QMAKE_ARGS="-nocache -d" +SPECS_DIR=$(qmake -query QMAKE_MKSPECS) +SPECS=$(find -L $SPECS_DIR | grep "qmake.conf" | grep -Ev "common|default" | grep "$1") + +SEDI="sed -i" +if [ $(uname) == "Darwin" ]; then + # Mac OS X requires an extension, Linux will barf on it being present + SEDI='sed -i .backup' +fi + +if [ ! -d tmp ]; then + mkdir tmp + touch tmp/empty.pro +fi + +if [ ! -d specs ]; then + mkdir specs +fi + +git checkout -- specs > /dev/null 2>&1 + +cd tmp +for spec in $SPECS; do + spec=$(echo $spec | sed "s|$SPECS_DIR/||" | sed "s|/qmake.conf||") + output_file=$(echo "$spec.txt" | sed "s|/|-|g") + echo "Dumping qmake variables for spec '$spec' to 'specs/$output_file'..." + qmake $QMAKE_ARGS -spec $spec empty.pro 2>&1 | + sed -n '/Dumping all variables/,$p' | + grep -Ev "(QMAKE_INTERNAL_INCLUDED_FILES|DISTFILES) ===" > ../specs/$output_file + + if [ -n $QTDIR ]; then + $SEDI "s|$QTDIR|\$QTDIR|g" ../specs/$output_file + fi + + if [ -n $QTSRCDIR ]; then + $SEDI "s|$QTSRCDIR|\$QTDIR|g" ../specs/$output_file + fi +done +cd .. + +rm -f specs/*.backup + +git diff --exit-code -- specs > /dev/null +exit_code=$? + +if [ $exit_code -eq 0 ]; then + echo -e "\nNo diff produced (you did good)" +else + # Show the resulting diff + git diff -- specs +fi + +exit $exit_code + diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro index caa9028..1d78aa3 100644 --- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro +++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp OTHER_FILES = glyphshaping_data.xml glyphshaping_data.path = . -glyphshaping_data.sources = $$PWD/glyphshaping_data.xml +glyphshaping_data.files = $$PWD/glyphshaping_data.xml DEPLOYMENT += glyphshaping_data |