diff options
Diffstat (limited to 'tests/auto')
23 files changed, 361 insertions, 361 deletions
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index b7b5a45..60c6b3d 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -42,8 +42,8 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlview.h> -#include <QtDeclarative/qfxrect.h> -#include <QtDeclarative/private/qfxanchors_p.h> +#include <private/qmlgraphicsrect_p.h> +#include <QtDeclarative/private/qmlgraphicsanchors_p_p.h> class tst_anchors : public QObject @@ -53,7 +53,7 @@ public: tst_anchors() {} template<typename T> - T *findItem(QFxItem *parent, const QString &id); + T *findItem(QmlGraphicsItem *parent, const QString &id); private slots: void basicAnchors(); @@ -67,12 +67,12 @@ private slots: Find an item with the specified id. */ template<typename T> -T *tst_anchors::findItem(QFxItem *parent, const QString &objectName) +T *tst_anchors::findItem(QmlGraphicsItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; QList<QGraphicsItem *> children = parent->childItems(); for (int i = 0; i < children.count(); ++i) { - QFxItem *item = qobject_cast<QFxItem *>(children.at(i)->toGraphicsObject()); + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem *>(children.at(i)->toGraphicsObject()); if (item) { if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { return static_cast<T*>(item); @@ -95,41 +95,41 @@ void tst_anchors::basicAnchors() qApp->processEvents(); //sibling horizontal - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect1"))->x(), 26.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect2"))->x(), 122.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect3"))->x(), 74.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect4"))->x(), 16.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect5"))->x(), 112.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect6"))->x(), 64.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect1"))->x(), 26.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect2"))->x(), 122.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect3"))->x(), 74.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect4"))->x(), 16.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect5"))->x(), 112.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect6"))->x(), 64.0); //parent horizontal - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect7"))->x(), 0.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect8"))->x(), 240.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect9"))->x(), 120.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect10"))->x(), -10.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect11"))->x(), 230.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect12"))->x(), 110.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect7"))->x(), 0.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect8"))->x(), 240.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect9"))->x(), 120.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect10"))->x(), -10.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect11"))->x(), 230.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect12"))->x(), 110.0); //vertical - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect13"))->y(), 20.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect14"))->y(), 155.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect13"))->y(), 20.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect14"))->y(), 155.0); //stretch - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect15"))->x(), 26.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect15"))->width(), 96.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect16"))->x(), 26.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect16"))->width(), 192.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect17"))->x(), -70.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect17"))->width(), 192.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect15"))->x(), 26.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect15"))->width(), 96.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect16"))->x(), 26.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect16"))->width(), 192.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect17"))->x(), -70.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect17"))->width(), 192.0); //vertical stretch - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect18"))->y(), 20.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect18"))->height(), 40.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect18"))->y(), 20.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect18"))->height(), 40.0); //more parent horizontal - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect19"))->x(), 115.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect20"))->x(), 235.0); - QCOMPARE(findItem<QFxRect>(view->root(), QLatin1String("Rect21"))->x(), -5.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect19"))->x(), 115.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect20"))->x(), 235.0); + QCOMPARE(findItem<QmlGraphicsRect>(view->root(), QLatin1String("Rect21"))->x(), -5.0); delete view; } @@ -142,7 +142,7 @@ void tst_anchors::loops() view->setUrl(QUrl("file://" SRCDIR "/data/loop1.qml")); - QString expect = "QML QFxText (" + view->url().toString() + ":7:5" + ") Possible anchor loop detected on horizontal anchor."; + QString expect = "QML QmlGraphicsText (" + view->url().toString() + ":7:5" + ") Possible anchor loop detected on horizontal anchor."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); @@ -157,7 +157,7 @@ void tst_anchors::loops() view->setUrl(QUrl("file://" SRCDIR "/data/loop2.qml")); - QString expect = "QML QFxImage (" + view->url().toString() + ":14:3" + ") Possible anchor loop detected on horizontal anchor."; + QString expect = "QML QmlGraphicsImage (" + view->url().toString() + ":14:3" + ") Possible anchor loop detected on horizontal anchor."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); view->execute(); qApp->processEvents(); @@ -173,7 +173,7 @@ void tst_anchors::illegalSets() view->setUrl(QUrl("file://" SRCDIR "/data/illegal1.qml")); - QString expect = "QML QFxRect (" + view->url().toString() + ":7:5" + ") Can't specify left, right, and hcenter anchors."; + QString expect = "QML QmlGraphicsRect (" + view->url().toString() + ":7:5" + ") Can't specify left, right, and hcenter anchors."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); view->execute(); qApp->processEvents(); @@ -186,7 +186,7 @@ void tst_anchors::illegalSets() view->setUrl(QUrl("file://" SRCDIR "/data/illegal2.qml")); - QString expect = "QML QFxText (" + view->url().toString() + ":7:5" + ") Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors."; + QString expect = "QML QmlGraphicsText (" + view->url().toString() + ":7:5" + ") Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); view->execute(); //qApp->processEvents(); @@ -199,7 +199,7 @@ void tst_anchors::illegalSets() view->setUrl(QUrl("file://" SRCDIR "/data/illegal3.qml")); - QString expect = "QML QFxRect (" + view->url().toString() + ":9:5" + ") Can't anchor to an item that isn't a parent or sibling."; + QString expect = "QML QmlGraphicsRect (" + view->url().toString() + ":9:5" + ") Can't anchor to an item that isn't a parent or sibling."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); view->execute(); //qApp->processEvents(); @@ -210,25 +210,25 @@ void tst_anchors::illegalSets() void tst_anchors::reset() { - QFxItem *aItem = new QFxItem; - QFxAnchorLine anchor; + QmlGraphicsItem *aItem = new QmlGraphicsItem; + QmlGraphicsAnchorLine anchor; anchor.item = aItem; - anchor.anchorLine = QFxAnchorLine::Top; + anchor.anchorLine = QmlGraphicsAnchorLine::Top; - QFxItem *item = new QFxItem; + QmlGraphicsItem *item = new QmlGraphicsItem; item->anchors()->setBottom(anchor); - QCOMPARE(item->anchors()->usedAnchors().testFlag(QFxAnchors::HasBottomAnchor), true); + QCOMPARE(item->anchors()->usedAnchors().testFlag(QmlGraphicsAnchors::HasBottomAnchor), true); item->anchors()->resetBottom(); - QCOMPARE(item->anchors()->usedAnchors().testFlag(QFxAnchors::HasBottomAnchor), false); + QCOMPARE(item->anchors()->usedAnchors().testFlag(QmlGraphicsAnchors::HasBottomAnchor), false); } void tst_anchors::nullItem() { - QFxAnchorLine anchor; + QmlGraphicsAnchorLine anchor; - QTest::ignoreMessage(QtWarningMsg, "QML QFxItem (unknown location) Can't anchor to a null item."); - QFxItem *item = new QFxItem; + QTest::ignoreMessage(QtWarningMsg, "QML QmlGraphicsItem (unknown location) Can't anchor to a null item."); + QmlGraphicsItem *item = new QmlGraphicsItem; item->anchors()->setBottom(anchor); } diff --git a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp index 440973a..a82c8e6 100644 --- a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp +++ b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp @@ -42,9 +42,9 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlview.h> -#include <QtDeclarative/qfxrect.h> -#include <QtDeclarative/qfximage.h> -#include "qfxanimatedimageitem.h" +#include <private/qmlgraphicsrect_p.h> +#include <private/qmlgraphicsimage_p.h> +#include <private/qmlgraphicsanimatedimageitem_p.h> class tst_animatedimage : public QObject { @@ -61,14 +61,14 @@ private slots: void tst_animatedimage::play() { - QFxAnimatedImageItem anim; + QmlGraphicsAnimatedImageItem anim; anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif")); QVERIFY(anim.isPlaying()); } void tst_animatedimage::pause() { - QFxAnimatedImageItem anim; + QmlGraphicsAnimatedImageItem anim; anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif")); anim.setPaused(true); QVERIFY(!anim.isPlaying()); @@ -76,7 +76,7 @@ void tst_animatedimage::pause() void tst_animatedimage::setFrame() { - QFxAnimatedImageItem anim; + QmlGraphicsAnimatedImageItem anim; anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif")); anim.setPaused(true); QVERIFY(!anim.isPlaying()); @@ -86,7 +86,7 @@ void tst_animatedimage::setFrame() void tst_animatedimage::frameCount() { - QFxAnimatedImageItem anim; + QmlGraphicsAnimatedImageItem anim; anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif")); QCOMPARE(anim.frameCount(), 299); } diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 141174a..77a31e5 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -42,8 +42,8 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlview.h> -#include <QtDeclarative/qfxrect.h> -#include <QtDeclarative/QmlNumberAnimation> +#include <private/qmlgraphicsrect_p.h> +#include <private/qmlanimation_p.h> class tst_animations : public QObject { @@ -72,7 +72,7 @@ private slots: void tst_animations::simpleNumber() { - QFxRect rect; + QmlGraphicsRect rect; QmlNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -90,7 +90,7 @@ void tst_animations::simpleNumber() void tst_animations::simpleColor() { - QFxRect rect; + QmlGraphicsRect rect; QmlColorAnimation animation; animation.setTarget(&rect); animation.setProperty("color"); @@ -108,7 +108,7 @@ void tst_animations::simpleColor() void tst_animations::alwaysRunToEnd() { - QFxRect rect; + QmlGraphicsRect rect; QmlPropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -126,7 +126,7 @@ void tst_animations::alwaysRunToEnd() void tst_animations::dotProperty() { - QFxRect rect; + QmlGraphicsRect rect; QmlNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("border.width"); @@ -181,12 +181,12 @@ void tst_animations::badTypes() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badtype4.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("state1"); QTest::qWait(1000 + 50); - QFxRect *myRect = qobject_cast<QFxRect*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRect *myRect = qobject_cast<QmlGraphicsRect*>(rect->QGraphicsObject::children().at(3)); //### not robust QVERIFY(myRect); QCOMPARE(myRect->x(),qreal(200)); } @@ -198,7 +198,7 @@ void tst_animations::badProperties() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\""); @@ -214,12 +214,12 @@ void tst_animations::mixedTypes() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/mixedtype1.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("state1"); QTest::qWait(500); - QFxRect *myRect = qobject_cast<QFxRect*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRect *myRect = qobject_cast<QmlGraphicsRect*>(rect->QGraphicsObject::children().at(3)); //### not robust QVERIFY(myRect); //rather inexact -- is there a better way? @@ -230,12 +230,12 @@ void tst_animations::mixedTypes() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/mixedtype2.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("state1"); QTest::qWait(500); - QFxRect *myRect = qobject_cast<QFxRect*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRect *myRect = qobject_cast<QmlGraphicsRect*>(rect->QGraphicsObject::children().at(3)); //### not robust QVERIFY(myRect); //rather inexact -- is there a better way? diff --git a/tests/auto/declarative/behaviors/tst_behaviors.cpp b/tests/auto/declarative/behaviors/tst_behaviors.cpp index 073d5bc..aea5604 100644 --- a/tests/auto/declarative/behaviors/tst_behaviors.cpp +++ b/tests/auto/declarative/behaviors/tst_behaviors.cpp @@ -42,8 +42,8 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlview.h> -#include <QtDeclarative/qfxrect.h> -#include <QtDeclarative/QmlNumberAnimation> +#include <private/qmlgraphicsrect_p.h> +#include <private/qmlanimation_p.h> class tst_behaviors : public QObject { @@ -66,12 +66,12 @@ void tst_behaviors::simpleBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/simple.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("moved"); QTest::qWait(100); - qreal x = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect"))->x(); + qreal x = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -79,12 +79,12 @@ void tst_behaviors::scriptTriggered() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/scripttrigger.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setColor(QColor("red")); QTest::qWait(100); - qreal x = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect"))->x(); + qreal x = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } @@ -92,10 +92,10 @@ void tst_behaviors::cppTriggered() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/cpptrigger.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); - QFxRect *innerRect = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect")); + QmlGraphicsRect *innerRect = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect")); QVERIFY(innerRect); innerRect->setProperty("x", 200); @@ -108,7 +108,7 @@ void tst_behaviors::loop() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/loop.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); //don't crash @@ -119,12 +119,12 @@ void tst_behaviors::colorBehavior() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/color.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("red"); QTest::qWait(100); - QColor color = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect"))->color(); + QColor color = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect"))->color(); QVERIFY(color != QColor("red") && color != QColor("green")); //i.e. the behavior has been triggered } @@ -132,12 +132,12 @@ void tst_behaviors::replaceBinding() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/binding.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("moved"); QTest::qWait(100); - QFxRect *innerRect = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect")); + QmlGraphicsRect *innerRect = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect")); QVERIFY(innerRect); qreal x = innerRect->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered @@ -167,24 +167,24 @@ void tst_behaviors::group() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/groupProperty.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("moved"); QTest::qWait(100); - qreal x = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect"))->x(); + qreal x = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/groupProperty2.qml")); - QFxRect *rect = qobject_cast<QFxRect*>(c.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(c.create()); QVERIFY(rect); rect->setState("moved"); QTest::qWait(100); - qreal x = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("MyRect"))->x(); + qreal x = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("MyRect"))->x(); QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered } } diff --git a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp index a59953a..1712b86 100644 --- a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp +++ b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp @@ -41,7 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qmldatetimeformatter.h> +#include <private/qmldatetimeformatter_p.h> #include <QDebug> class tst_datetimeformatter : public QObject diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index 31e5415..fbcc904 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -39,16 +39,16 @@ ** ****************************************************************************/ #include <QtTest/QtTest> -#include <qlistmodelinterface.h> +#include <private/qlistmodelinterface_p.h> #include <qmlview.h> -#include <qfxrect.h> +#include <private/qmlgraphicsrect_p.h> #include <qmlexpression.h> -class tst_QFxLayouts : public QObject +class tst_QmlGraphicsLayouts : public QObject { Q_OBJECT public: - tst_QFxLayouts(); + tst_QmlGraphicsLayouts(); private slots: void test_horizontal(); @@ -62,24 +62,24 @@ private: QmlView *createView(const QString &filename); }; -tst_QFxLayouts::tst_QFxLayouts() +tst_QmlGraphicsLayouts::tst_QmlGraphicsLayouts() { } -void tst_QFxLayouts::test_horizontal() +void tst_QmlGraphicsLayouts::test_horizontal() { QmlView *canvas = createView(SRCDIR "/data/horizontal.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -90,20 +90,20 @@ void tst_QFxLayouts::test_horizontal() QCOMPARE(three->y(), 0.0); } -void tst_QFxLayouts::test_horizontal_spacing() +void tst_QmlGraphicsLayouts::test_horizontal_spacing() { QmlView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -114,20 +114,20 @@ void tst_QFxLayouts::test_horizontal_spacing() QCOMPARE(three->y(), 0.0); } -void tst_QFxLayouts::test_vertical() +void tst_QmlGraphicsLayouts::test_vertical() { QmlView *canvas = createView(SRCDIR "/data/vertical.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -138,20 +138,20 @@ void tst_QFxLayouts::test_vertical() QCOMPARE(three->y(), 60.0); } -void tst_QFxLayouts::test_vertical_spacing() +void tst_QmlGraphicsLayouts::test_vertical_spacing() { QmlView *canvas = createView(SRCDIR "/data/vertical-spacing.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -162,22 +162,22 @@ void tst_QFxLayouts::test_vertical_spacing() QCOMPARE(three->y(), 80.0); } -void tst_QFxLayouts::test_grid() +void tst_QmlGraphicsLayouts::test_grid() { QmlView *canvas = createView("data/grid.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); - QFxRect *four = canvas->root()->findChild<QFxRect*>("four"); + QmlGraphicsRect *four = canvas->root()->findChild<QmlGraphicsRect*>("four"); QVERIFY(four != 0); - QFxRect *five = canvas->root()->findChild<QFxRect*>("five"); + QmlGraphicsRect *five = canvas->root()->findChild<QmlGraphicsRect*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -192,22 +192,22 @@ void tst_QFxLayouts::test_grid() QCOMPARE(five->y(), 50.0); } -void tst_QFxLayouts::test_grid_spacing() +void tst_QmlGraphicsLayouts::test_grid_spacing() { QmlView *canvas = createView("data/grid-spacing.qml"); canvas->execute(); qApp->processEvents(); - QFxRect *one = canvas->root()->findChild<QFxRect*>("one"); + QmlGraphicsRect *one = canvas->root()->findChild<QmlGraphicsRect*>("one"); QVERIFY(one != 0); - QFxRect *two = canvas->root()->findChild<QFxRect*>("two"); + QmlGraphicsRect *two = canvas->root()->findChild<QmlGraphicsRect*>("two"); QVERIFY(two != 0); - QFxRect *three = canvas->root()->findChild<QFxRect*>("three"); + QmlGraphicsRect *three = canvas->root()->findChild<QmlGraphicsRect*>("three"); QVERIFY(three != 0); - QFxRect *four = canvas->root()->findChild<QFxRect*>("four"); + QmlGraphicsRect *four = canvas->root()->findChild<QmlGraphicsRect*>("four"); QVERIFY(four != 0); - QFxRect *five = canvas->root()->findChild<QFxRect*>("five"); + QmlGraphicsRect *five = canvas->root()->findChild<QmlGraphicsRect*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -222,7 +222,7 @@ void tst_QFxLayouts::test_grid_spacing() QCOMPARE(five->y(), 54.0); } -QmlView *tst_QFxLayouts::createView(const QString &filename) +QmlView *tst_QmlGraphicsLayouts::createView(const QString &filename) { QmlView *canvas = new QmlView(0); @@ -235,6 +235,6 @@ QmlView *tst_QFxLayouts::createView(const QString &filename) } -QTEST_MAIN(tst_QFxLayouts) +QTEST_MAIN(tst_QmlGraphicsLayouts) #include "tst_layouts.moc" diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 462ae21..42d4900 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -39,18 +39,18 @@ ** ****************************************************************************/ #include <QtTest/QtTest> -#include <qlistmodelinterface.h> +#include <private/qlistmodelinterface_p.h> #include <qmlview.h> -#include <qfxlistview.h> -#include <qfxtext.h> +#include <private/qmlgraphicslistview_p.h> +#include <private/qmlgraphicstext_p.h> #include <qmlcontext.h> #include <qmlexpression.h> -class tst_QFxListView : public QObject +class tst_QmlGraphicsListView : public QObject { Q_OBJECT public: - tst_QFxListView(); + tst_QmlGraphicsListView(); private slots: // Test both QListModelInterface and QAbstractItemModel model types @@ -73,9 +73,9 @@ private: template <class T> void removed(); QmlView *createView(const QString &filename); template<typename T> - T *findItem(QFxItem *parent, const QString &id, int index=-1); + T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); template<typename T> - QList<T*> findItems(QFxItem *parent, const QString &objectName); + QList<T*> findItems(QmlGraphicsItem *parent, const QString &objectName); }; class TestModel : public QListModelInterface @@ -204,12 +204,12 @@ private: QList<QPair<QString,QString> > list; }; -tst_QFxListView::tst_QFxListView() +tst_QmlGraphicsListView::tst_QmlGraphicsListView() { } template <class T> -void tst_QFxListView::items() +void tst_QmlGraphicsListView::items() { QmlView *canvas = createView(SRCDIR "/data/listview.qml"); @@ -224,19 +224,19 @@ void tst_QFxListView::items() canvas->execute(); qApp->processEvents(); - QFxFlickable *listview = findItem<QFxFlickable>(canvas->root(), "list"); + QmlGraphicsFlickable *listview = findItem<QmlGraphicsFlickable>(canvas->root(), "list"); QVERIFY(listview != 0); - QFxItem *viewport = listview->viewport(); + QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item for (int i = 0; i < model.count(); ++i) { - QFxText *name = findItem<QFxText>(viewport, "textName", i); + QmlGraphicsText *name = findItem<QmlGraphicsText>(viewport, "textName", i); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(i)); - QFxText *number = findItem<QFxText>(viewport, "textNumber", i); + QmlGraphicsText *number = findItem<QmlGraphicsText>(viewport, "textNumber", i); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(i)); } @@ -245,7 +245,7 @@ void tst_QFxListView::items() } template <class T> -void tst_QFxListView::changed() +void tst_QmlGraphicsListView::changed() { QmlView *canvas = createView(SRCDIR "/data/listview.qml"); @@ -260,17 +260,17 @@ void tst_QFxListView::changed() canvas->execute(); qApp->processEvents(); - QFxFlickable *listview = findItem<QFxFlickable>(canvas->root(), "list"); + QmlGraphicsFlickable *listview = findItem<QmlGraphicsFlickable>(canvas->root(), "list"); QVERIFY(listview != 0); - QFxItem *viewport = listview->viewport(); + QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); model.modifyItem(1, "Will", "9876"); - QFxText *name = findItem<QFxText>(viewport, "textName", 1); + QmlGraphicsText *name = findItem<QmlGraphicsText>(viewport, "textName", 1); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(1)); - QFxText *number = findItem<QFxText>(viewport, "textNumber", 1); + QmlGraphicsText *number = findItem<QmlGraphicsText>(viewport, "textNumber", 1); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(1)); @@ -278,7 +278,7 @@ void tst_QFxListView::changed() } template <class T> -void tst_QFxListView::inserted() +void tst_QmlGraphicsListView::inserted() { QmlView *canvas = createView(SRCDIR "/data/listview.qml"); @@ -293,10 +293,10 @@ void tst_QFxListView::inserted() canvas->execute(); qApp->processEvents(); - QFxListView *listview = findItem<QFxListView>(canvas->root(), "list"); + QmlGraphicsListView *listview = findItem<QmlGraphicsListView>(canvas->root(), "list"); QVERIFY(listview != 0); - QFxItem *viewport = listview->viewport(); + QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); model.insertItem(1, "Will", "9876"); @@ -306,16 +306,16 @@ void tst_QFxListView::inserted() QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - QFxText *name = findItem<QFxText>(viewport, "textName", 1); + QmlGraphicsText *name = findItem<QmlGraphicsText>(viewport, "textName", 1); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(1)); - QFxText *number = findItem<QFxText>(viewport, "textNumber", 1); + QmlGraphicsText *number = findItem<QmlGraphicsText>(viewport, "textNumber", 1); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(1)); // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); QVERIFY(item->y() == i*20); } @@ -326,10 +326,10 @@ void tst_QFxListView::inserted() QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - name = findItem<QFxText>(viewport, "textName", 0); + name = findItem<QmlGraphicsText>(viewport, "textName", 0); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(0)); - number = findItem<QFxText>(viewport, "textNumber", 0); + number = findItem<QmlGraphicsText>(viewport, "textNumber", 0); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(0)); @@ -337,7 +337,7 @@ void tst_QFxListView::inserted() // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); QVERIFY(item->y() == i*20); } @@ -345,7 +345,7 @@ void tst_QFxListView::inserted() } template <class T> -void tst_QFxListView::removed() +void tst_QmlGraphicsListView::removed() { QmlView *canvas = createView(SRCDIR "/data/listview.qml"); @@ -359,10 +359,10 @@ void tst_QFxListView::removed() canvas->execute(); qApp->processEvents(); - QFxListView *listview = findItem<QFxListView>(canvas->root(), "list"); + QmlGraphicsListView *listview = findItem<QmlGraphicsListView>(canvas->root(), "list"); QVERIFY(listview != 0); - QFxItem *viewport = listview->viewport(); + QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); model.removeItem(1); @@ -370,17 +370,17 @@ void tst_QFxListView::removed() // let transitions settle. QTest::qWait(1000); - QFxText *name = findItem<QFxText>(viewport, "textName", 1); + QmlGraphicsText *name = findItem<QmlGraphicsText>(viewport, "textName", 1); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(1)); - QFxText *number = findItem<QFxText>(viewport, "textNumber", 1); + QmlGraphicsText *number = findItem<QmlGraphicsText>(viewport, "textNumber", 1); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(1)); // Confirm items positioned correctly - int itemCount = findItems<QFxItem>(viewport, "wrapper").count(); + int itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); QVERIFY(item->y() == i*20); @@ -392,17 +392,17 @@ void tst_QFxListView::removed() // let transitions settle. QTest::qWait(1000); - name = findItem<QFxText>(viewport, "textName", 0); + name = findItem<QmlGraphicsText>(viewport, "textName", 0); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(0)); - number = findItem<QFxText>(viewport, "textNumber", 0); + number = findItem<QmlGraphicsText>(viewport, "textNumber", 0); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(0)); // Confirm items positioned correctly - itemCount = findItems<QFxItem>(viewport, "wrapper").count(); + itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); QCOMPARE(item->y(),i*20.0 + 20.0); @@ -414,9 +414,9 @@ void tst_QFxListView::removed() QTest::qWait(1000); // Confirm items positioned correctly - itemCount = findItems<QFxItem>(viewport, "wrapper").count(); + itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); QCOMPARE(item->y(),i*20.0+20.0); @@ -432,7 +432,7 @@ void tst_QFxListView::removed() // Confirm items positioned correctly for (int i = 2; i < 18; ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); QCOMPARE(item->y(),40+i*20.0); @@ -443,9 +443,9 @@ void tst_QFxListView::removed() QTest::qWait(1000); // Confirm items positioned correctly - itemCount = findItems<QFxItem>(viewport, "wrapper").count(); + itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QFxItem *item = findItem<QFxItem>(viewport, "wrapper", i); + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); QCOMPARE(item->y(),40+i*20.0); @@ -454,47 +454,47 @@ void tst_QFxListView::removed() delete canvas; } -void tst_QFxListView::qListModelInterface_items() +void tst_QmlGraphicsListView::qListModelInterface_items() { items<TestModel>(); } -void tst_QFxListView::qAbstractItemModel_items() +void tst_QmlGraphicsListView::qAbstractItemModel_items() { items<TestModel2>(); } -void tst_QFxListView::qListModelInterface_changed() +void tst_QmlGraphicsListView::qListModelInterface_changed() { changed<TestModel>(); } -void tst_QFxListView::qAbstractItemModel_changed() +void tst_QmlGraphicsListView::qAbstractItemModel_changed() { changed<TestModel2>(); } -void tst_QFxListView::qListModelInterface_inserted() +void tst_QmlGraphicsListView::qListModelInterface_inserted() { inserted<TestModel>(); } -void tst_QFxListView::qAbstractItemModel_inserted() +void tst_QmlGraphicsListView::qAbstractItemModel_inserted() { inserted<TestModel2>(); } -void tst_QFxListView::qListModelInterface_removed() +void tst_QmlGraphicsListView::qListModelInterface_removed() { removed<TestModel>(); } -void tst_QFxListView::qAbstractItemModel_removed() +void tst_QmlGraphicsListView::qAbstractItemModel_removed() { removed<TestModel2>(); } -QmlView *tst_QFxListView::createView(const QString &filename) +QmlView *tst_QmlGraphicsListView::createView(const QString &filename) { QmlView *canvas = new QmlView(0); canvas->setFixedSize(240,320); @@ -512,12 +512,12 @@ QmlView *tst_QFxListView::createView(const QString &filename) item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QFxListView::findItem(QFxItem *parent, const QString &objectName, int index) +T *tst_QmlGraphicsListView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->QGraphicsObject::children().count() << "children"; for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QFxItem *item = qobject_cast<QFxItem*>(parent->QGraphicsObject::children().at(i)); + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->QGraphicsObject::children().at(i)); if(!item) continue; //qDebug() << "try" << item; @@ -540,13 +540,13 @@ T *tst_QFxListView::findItem(QFxItem *parent, const QString &objectName, int ind } template<typename T> -QList<T*> tst_QFxListView::findItems(QFxItem *parent, const QString &objectName) +QList<T*> tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QString &objectName) { QList<T*> items; const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->QGraphicsObject::children().count() << "children"; for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QFxItem *item = qobject_cast<QFxItem*>(parent->QGraphicsObject::children().at(i)); + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->QGraphicsObject::children().at(i)); if(!item) continue; //qDebug() << "try" << item; @@ -559,6 +559,6 @@ QList<T*> tst_QFxListView::findItems(QFxItem *parent, const QString &objectName) } -QTEST_MAIN(tst_QFxListView) +QTEST_MAIN(tst_QmlGraphicsListView) #include "tst_listview.moc" diff --git a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp index 31816fa..152d6e3 100644 --- a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp +++ b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp @@ -42,8 +42,8 @@ #include <QDebug> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qnumberformat.h> -#include <QtDeclarative/qmlnumberformatter.h> +#include <private/qnumberformat_p.h> +#include <private/qmlnumberformatter_p.h> class tst_numberformat : public QObject { diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp index 2ab2ede..41decb1 100644 --- a/tests/auto/declarative/pathview/tst_pathview.cpp +++ b/tests/auto/declarative/pathview/tst_pathview.cpp @@ -39,19 +39,19 @@ ** ****************************************************************************/ #include <QtTest/QtTest> -#include <qlistmodelinterface.h> +#include <private/qlistmodelinterface_p.h> #include <qmlview.h> -#include <qfxpathview.h> -#include <qfxtext.h> -#include <qfxrect.h> +#include <private/qmlgraphicspathview_p.h> +#include <private/qmlgraphicstext_p.h> +#include <private/qmlgraphicsrect_p.h> #include <qmlcontext.h> #include <qmlexpression.h> -class tst_QFxPathView : public QObject +class tst_QmlGraphicsPathView : public QObject { Q_OBJECT public: - tst_QFxPathView(); + tst_QmlGraphicsPathView(); private slots: void items(); @@ -61,7 +61,7 @@ private slots: private: QmlView *createView(const QString &filename); template<typename T> - T *findItem(QFxItem *parent, const QString &id, int index=-1); + T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); }; class TestModel : public QListModelInterface @@ -135,11 +135,11 @@ private: QList<QPair<QString,QString> > list; }; -tst_QFxPathView::tst_QFxPathView() +tst_QmlGraphicsPathView::tst_QmlGraphicsPathView() { } -void tst_QFxPathView::items() +void tst_QmlGraphicsPathView::items() { QmlView *canvas = createView(SRCDIR "/data/pathview.qml"); @@ -154,16 +154,16 @@ void tst_QFxPathView::items() canvas->execute(); qApp->processEvents(); - QFxPathView *pathview = findItem<QFxPathView>(canvas->root(), "view"); + QmlGraphicsPathView *pathview = findItem<QmlGraphicsPathView>(canvas->root(), "view"); QVERIFY(pathview != 0); QCOMPARE(pathview->childItems().count(), model.count()); // assumes all are visible for (int i = 0; i < model.count(); ++i) { - QFxText *name = findItem<QFxText>(pathview, "textName", i); + QmlGraphicsText *name = findItem<QmlGraphicsText>(pathview, "textName", i); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(i)); - QFxText *number = findItem<QFxText>(pathview, "textNumber", i); + QmlGraphicsText *number = findItem<QmlGraphicsText>(pathview, "textNumber", i); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(i)); } @@ -171,7 +171,7 @@ void tst_QFxPathView::items() delete canvas; } -void tst_QFxPathView::pathMoved() +void tst_QmlGraphicsPathView::pathMoved() { QmlView *canvas = createView(SRCDIR "/data/pathview.qml"); @@ -187,12 +187,12 @@ void tst_QFxPathView::pathMoved() canvas->execute(); qApp->processEvents(); - QFxPathView *pathview = findItem<QFxPathView>(canvas->root(), "view"); + QmlGraphicsPathView *pathview = findItem<QmlGraphicsPathView>(canvas->root(), "view"); QVERIFY(pathview != 0); - QFxRect *firstItem = findItem<QFxRect>(pathview, "wrapper", 0); + QmlGraphicsRect *firstItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 0); QVERIFY(firstItem); - QFxPath *path = qobject_cast<QFxPath*>(pathview->path()); + QmlGraphicsPath *path = qobject_cast<QmlGraphicsPath*>(pathview->path()); QVERIFY(path); QPointF start = path->pointAt(0.0); QPointF offset;//Center of item is at point, but pos is from corner @@ -203,7 +203,7 @@ void tst_QFxPathView::pathMoved() QTest::qWait(1000);//Moving is animated? for(int i=0; i<model.count(); i++){ - QFxRect *curItem = findItem<QFxRect>(pathview, "wrapper", i); + QmlGraphicsRect *curItem = findItem<QmlGraphicsRect>(pathview, "wrapper", i); QCOMPARE(curItem->pos() + offset, path->pointAt(0.1 + i*0.25)); } @@ -214,7 +214,7 @@ void tst_QFxPathView::pathMoved() delete canvas; } -void tst_QFxPathView::limitedItems() +void tst_QmlGraphicsPathView::limitedItems() { QmlView *canvas = createView(SRCDIR "/data/pathview.qml"); @@ -228,32 +228,32 @@ void tst_QFxPathView::limitedItems() canvas->execute(); qApp->processEvents(); - QFxPathView *pathview = findItem<QFxPathView>(canvas->root(), "view"); + QmlGraphicsPathView *pathview = findItem<QmlGraphicsPathView>(canvas->root(), "view"); QVERIFY(pathview != 0); pathview->setPathItemCount(10); QCOMPARE(pathview->pathItemCount(), 10); - QFxRect *testItem = findItem<QFxRect>(pathview, "wrapper", 0); + QmlGraphicsRect *testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 0); QVERIFY(testItem != 0); - testItem = findItem<QFxRect>(pathview, "wrapper", 9); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 9); QVERIFY(testItem != 0); - testItem = findItem<QFxRect>(pathview, "wrapper", 10); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 10); QVERIFY(testItem == 0); pathview->setCurrentIndex(50); QTest::qWait(5100);//Moving is animated and it's travelling far - should be reconsidered. - testItem = findItem<QFxRect>(pathview, "wrapper", 0); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 0); QVERIFY(testItem == 0); - testItem = findItem<QFxRect>(pathview, "wrapper", 1); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 1); QVERIFY(testItem == 0); - testItem = findItem<QFxRect>(pathview, "wrapper", 9); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 9); QVERIFY(testItem == 0); - testItem = findItem<QFxRect>(pathview, "wrapper", 50); + testItem = findItem<QmlGraphicsRect>(pathview, "wrapper", 50); QVERIFY(testItem != 0); } -QmlView *tst_QFxPathView::createView(const QString &filename) +QmlView *tst_QmlGraphicsPathView::createView(const QString &filename) { QmlView *canvas = new QmlView(0); canvas->setFixedSize(240,320); @@ -271,11 +271,11 @@ QmlView *tst_QFxPathView::createView(const QString &filename) item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QFxPathView::findItem(QFxItem *parent, const QString &objectName, int index) +T *tst_QmlGraphicsPathView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; for (int i = 0; i < parent->children().count(); ++i) { - QFxItem *item = qobject_cast<QFxItem*>(parent->children().at(i)); + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->children().at(i)); if(!item) continue; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { @@ -296,6 +296,6 @@ T *tst_QFxPathView::findItem(QFxItem *parent, const QString &objectName, int ind return 0; } -QTEST_MAIN(tst_QFxPathView) +QTEST_MAIN(tst_QmlGraphicsPathView) #include "tst_pathview.moc" diff --git a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp index 8d3905f..38d06b8 100644 --- a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp +++ b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp @@ -41,7 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxloader.h> +#include <private/qmlgraphicsloader_p.h> class tst_qfxloader : public QObject @@ -81,7 +81,7 @@ tst_qfxloader::tst_qfxloader() void tst_qfxloader::url() { QmlComponent component(&engine, QByteArray("import Qt 4.6\nLoader { source: \"Rect120x60.qml\" }"), QUrl("file://" SRCDIR "/")); - QFxLoader *loader = qobject_cast<QFxLoader*>(component.create()); + QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create()); QVERIFY(loader != 0); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -91,10 +91,10 @@ void tst_qfxloader::url() void tst_qfxloader::component() { QmlComponent component(&engine, QUrl("file://" SRCDIR "/SetSourceComponent.qml")); - QFxItem *item = qobject_cast<QFxItem*>(component.create()); + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(component.create()); QVERIFY(item); - QFxLoader *loader = qobject_cast<QFxLoader*>(item->QGraphicsObject::children().at(1)); + QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(item->QGraphicsObject::children().at(1)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -104,7 +104,7 @@ void tst_qfxloader::component() void tst_qfxloader::sizeLoaderToItem() { QmlComponent component(&engine, QUrl("file://" SRCDIR "/SizeToItem.qml")); - QFxLoader *loader = qobject_cast<QFxLoader*>(component.create()); + QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->width(), 120.0); QCOMPARE(loader->height(), 60.0); @@ -113,12 +113,12 @@ void tst_qfxloader::sizeLoaderToItem() void tst_qfxloader::sizeItemToLoader() { QmlComponent component(&engine, QUrl("file://" SRCDIR "/SizeToLoader.qml")); - QFxLoader *loader = qobject_cast<QFxLoader*>(component.create()); + QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->width(), 200.0); QCOMPARE(loader->height(), 80.0); - QFxItem *rect = loader->item(); + QmlGraphicsItem *rect = loader->item(); QVERIFY(rect); QCOMPARE(rect->width(), 200.0); QCOMPARE(rect->height(), 80.0); @@ -127,12 +127,12 @@ void tst_qfxloader::sizeItemToLoader() void tst_qfxloader::noResize() { QmlComponent component(&engine, QUrl("file://" SRCDIR "/NoResize.qml")); - QFxLoader *loader = qobject_cast<QFxLoader*>(component.create()); + QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->width(), 200.0); QCOMPARE(loader->height(), 80.0); - QFxItem *rect = loader->item(); + QmlGraphicsItem *rect = loader->item(); QVERIFY(rect); QCOMPARE(rect->width(), 120.0); QCOMPARE(rect->height(), 60.0); diff --git a/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp b/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp index 665aacd..88fbdab 100644 --- a/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp +++ b/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <qtest.h> #include <QtTest/QtTest> -#include <QtDeclarative/qfxpixmapcache.h> +#include <private/qmlgraphicspixmapcache_p.h> #include <QtDeclarative/qmlengine.h> #include <QNetworkReply> @@ -99,7 +99,7 @@ static const bool localfile_optimized = false; void tst_qfxpixmapcache::single_data() { - // Note, since QFxPixmapCache is shared, tests affect each other! + // Note, since QmlGraphicsPixmapCache is shared, tests affect each other! // so use different files fore all test functions. QTest::addColumn<QUrl>("target"); @@ -130,7 +130,7 @@ void tst_qfxpixmapcache::single() QPixmap pixmap; QVERIFY(pixmap.width() <= 0); // Check Qt assumption - QNetworkReply *reply= QFxPixmapCache::get(&engine, target, &pixmap); + QNetworkReply *reply= QmlGraphicsPixmapCache::get(&engine, target, &pixmap); if (incache) { QVERIFY(!reply); @@ -148,20 +148,20 @@ void tst_qfxpixmapcache::single() QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(getter.gotslot); if (exists) { - QVERIFY(QFxPixmapCache::find(target, &pixmap)); + QVERIFY(QmlGraphicsPixmapCache::find(target, &pixmap)); QVERIFY(pixmap.width() > 0); } else { - QVERIFY(!QFxPixmapCache::find(target, &pixmap)); + QVERIFY(!QmlGraphicsPixmapCache::find(target, &pixmap)); QVERIFY(pixmap.width() <= 0); } } - QCOMPARE(QFxPixmapCache::pendingRequests(), 0); + QCOMPARE(QmlGraphicsPixmapCache::pendingRequests(), 0); } void tst_qfxpixmapcache::parallel_data() { - // Note, since QFxPixmapCache is shared, tests affect each other! + // Note, since QmlGraphicsPixmapCache is shared, tests affect each other! // so use different files fore all test functions. QTest::addColumn<QUrl>("target1"); @@ -227,7 +227,7 @@ void tst_qfxpixmapcache::parallel() for (int i=0; i<targets.count(); ++i) { QUrl target = targets.at(i); QPixmap pixmap; - QNetworkReply *reply = QFxPixmapCache::get(&engine, target, &pixmap); + QNetworkReply *reply = QmlGraphicsPixmapCache::get(&engine, target, &pixmap); replies.append(reply); if (!reply) { QVERIFY(pixmap.width() > 0); @@ -240,10 +240,10 @@ void tst_qfxpixmapcache::parallel() } QCOMPARE(incache+slotters, targets.count()); - QCOMPARE(QFxPixmapCache::pendingRequests(), requests); + QCOMPARE(QmlGraphicsPixmapCache::pendingRequests(), requests); if (cancel >= 0) { - QFxPixmapCache::cancelGet(targets.at(cancel), getters[cancel]); + QmlGraphicsPixmapCache::cancelGet(targets.at(cancel), getters[cancel]); slotters--; } @@ -260,14 +260,14 @@ void tst_qfxpixmapcache::parallel() } else { QVERIFY(getters[i]->gotslot); QPixmap pixmap; - QVERIFY(QFxPixmapCache::find(targets[i], &pixmap)); + QVERIFY(QmlGraphicsPixmapCache::find(targets[i], &pixmap)); QVERIFY(pixmap.width() > 0); } delete getters[i]; } } - QCOMPARE(QFxPixmapCache::pendingRequests(), 0); + QCOMPARE(QmlGraphicsPixmapCache::pendingRequests(), 0); } QTEST_MAIN(tst_qfxpixmapcache) diff --git a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp index e446409..173a3b4 100644 --- a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp +++ b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp @@ -42,7 +42,7 @@ #include <QTextDocument> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxtext.h> +#include <private/qmlgraphicstext_p.h> #include <QFontMetrics> class tst_qfxtext : public QObject @@ -76,7 +76,7 @@ private: QList<Qt::Alignment> horizontalAlignmentments; QStringList styleStrings; - QList<QFxText::TextStyle> styles; + QList<QmlGraphicsText::TextStyle> styles; QStringList colorStrings; @@ -112,10 +112,10 @@ tst_qfxtext::tst_qfxtext() << "Raised" << "Sunken"; - styles << QFxText::Normal - << QFxText::Outline - << QFxText::Raised - << QFxText::Sunken; + styles << QmlGraphicsText::Normal + << QmlGraphicsText::Outline + << QmlGraphicsText::Raised + << QmlGraphicsText::Sunken; colorStrings << "aliceblue" << "antiquewhite" @@ -140,7 +140,7 @@ void tst_qfxtext::text() { { QmlComponent textComponent(&engine, "import Qt 4.6\nText { text: \"\" }", QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->text(), QString("")); @@ -150,7 +150,7 @@ void tst_qfxtext::text() { QString componentStr = "import Qt 4.6\nText { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->text(), standard.at(i)); @@ -160,7 +160,7 @@ void tst_qfxtext::text() { QString componentStr = "import Qt 4.6\nText { text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QVERIFY(textObject != 0); QString expected = richText.at(i); @@ -173,7 +173,7 @@ void tst_qfxtext::width() // uses Font metrics to find the width for standard and document to find the width for rich { QmlComponent textComponent(&engine, "import Qt 4.6\nText { text: \"\" }", QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 0.); } @@ -186,7 +186,7 @@ void tst_qfxtext::width() QString componentStr = "import Qt 4.6\nText { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), qreal(metricWidth)); } @@ -201,7 +201,7 @@ void tst_qfxtext::width() QString componentStr = "import Qt 4.6\nText { text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), qreal(documentWidth)); } @@ -214,7 +214,7 @@ void tst_qfxtext::wrap() // for specified width and wrap set true { QmlComponent textComponent(&engine, "import Qt 4.6\nText { text: \"\"; wrap: true; width: 300 }", QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -223,7 +223,7 @@ void tst_qfxtext::wrap() { QString componentStr = "import Qt 4.6\nText { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -232,7 +232,7 @@ void tst_qfxtext::wrap() { QString componentStr = "import Qt 4.6\nText { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -249,7 +249,7 @@ void tst_qfxtext::elide() { QmlComponent textComponent(&engine, ("import Qt 4.6\nText { text: \"\"; "+elide+" width: 300 }").toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -258,7 +258,7 @@ void tst_qfxtext::elide() { QString componentStr = "import Qt 4.6\nText { "+elide+" width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -268,7 +268,7 @@ void tst_qfxtext::elide() { QString componentStr = "import Qt 4.6\nText { "+elide+" width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); } @@ -286,7 +286,7 @@ void tst_qfxtext::horizontalAlignment() { QString componentStr = "import Qt 4.6\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j)); } @@ -298,7 +298,7 @@ void tst_qfxtext::horizontalAlignment() { QString componentStr = "import Qt 4.6\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j)); } @@ -316,7 +316,7 @@ void tst_qfxtext::verticalAlignment() { QString componentStr = "import Qt 4.6\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j)); } @@ -328,7 +328,7 @@ void tst_qfxtext::verticalAlignment() { QString componentStr = "import Qt 4.6\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j)); } @@ -342,7 +342,7 @@ void tst_qfxtext::font() { QString componentStr = "import Qt 4.6\nText { font.pointSize: 40; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->font().pointSize(), 40); QCOMPARE(textObject->font().bold(), false); @@ -352,7 +352,7 @@ void tst_qfxtext::font() { QString componentStr = "import Qt 4.6\nText { font.bold: true; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->font().bold(), true); QCOMPARE(textObject->font().italic(), false); @@ -361,7 +361,7 @@ void tst_qfxtext::font() { QString componentStr = "import Qt 4.6\nText { font.italic: true; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->font().italic(), true); QCOMPARE(textObject->font().bold(), false); @@ -370,7 +370,7 @@ void tst_qfxtext::font() { QString componentStr = "import Qt 4.6\nText { font.family: \"Helvetica\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->font().family(), QString("Helvetica")); QCOMPARE(textObject->font().bold(), false); @@ -380,7 +380,7 @@ void tst_qfxtext::font() { QString componentStr = "import Qt 4.6\nText { font.family: \"\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->font().family(), QString("")); } @@ -393,7 +393,7 @@ void tst_qfxtext::style() { QString componentStr = "import Qt 4.6\nText { style: \"" + styleStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE((int)textObject->style(), (int)styles.at(i)); QCOMPARE(textObject->styleColor(), QColor()); @@ -407,7 +407,7 @@ void tst_qfxtext::color() { QString componentStr = "import Qt 4.6\nText { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->color(), QColor(colorStrings.at(i))); QCOMPARE(textObject->styleColor(), QColor()); @@ -417,7 +417,7 @@ void tst_qfxtext::color() { QString componentStr = "import Qt 4.6\nText { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(i))); // default color to black? @@ -430,7 +430,7 @@ void tst_qfxtext::color() { QString componentStr = "import Qt 4.6\nText { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->color(), QColor(colorStrings.at(i))); QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(j))); @@ -443,7 +443,7 @@ void tst_qfxtext::color() QString componentStr = "import Qt 4.6\nText { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); - QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); + QmlGraphicsText *textObject = qobject_cast<QmlGraphicsText*>(textComponent.create()); QCOMPARE(textObject->color(), testColor); } diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp index 4d9b440..7bc6121 100644 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp @@ -46,7 +46,7 @@ #include <QtDeclarative/qmlcontext.h> #include <QtDeclarative/qmlexpression.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxtextedit.h> +#include <private/qmlgraphicstextedit_p.h> #include <QFontMetrics> #include <QmlView> @@ -137,7 +137,7 @@ void tst_qfxtextedit::text() { { QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->text(), QString("")); @@ -147,7 +147,7 @@ void tst_qfxtextedit::text() { QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->text(), standard.at(i)); @@ -157,7 +157,7 @@ void tst_qfxtextedit::text() { QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QString actual = textEditObject->text(); @@ -174,7 +174,7 @@ void tst_qfxtextedit::width() // uses Font metrics to find the width for standard and document to find the width for rich { QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 1.);//+1 for cursor @@ -188,7 +188,7 @@ void tst_qfxtextedit::width() QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. @@ -204,7 +204,7 @@ void tst_qfxtextedit::width() QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); @@ -216,7 +216,7 @@ void tst_qfxtextedit::wrap() // for specified width and wrap set true { QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\"; wrap: true; width: 300 }", QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -226,7 +226,7 @@ void tst_qfxtextedit::wrap() { QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -236,7 +236,7 @@ void tst_qfxtextedit::wrap() { QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -255,7 +255,7 @@ void tst_qfxtextedit::hAlign() { QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); @@ -268,7 +268,7 @@ void tst_qfxtextedit::hAlign() { QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); @@ -287,7 +287,7 @@ void tst_qfxtextedit::vAlign() { QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); @@ -300,7 +300,7 @@ void tst_qfxtextedit::vAlign() { QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); @@ -315,7 +315,7 @@ void tst_qfxtextedit::font() { QString componentStr = "import Qt 4.6\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().pointSize(), 40); @@ -326,7 +326,7 @@ void tst_qfxtextedit::font() { QString componentStr = "import Qt 4.6\nTextEdit { font.bold: true; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().bold(), true); @@ -336,7 +336,7 @@ void tst_qfxtextedit::font() { QString componentStr = "import Qt 4.6\nTextEdit { font.italic: true; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().italic(), true); @@ -346,7 +346,7 @@ void tst_qfxtextedit::font() { QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().family(), QString("Helvetica")); @@ -357,7 +357,7 @@ void tst_qfxtextedit::font() { QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().family(), QString("")); @@ -371,7 +371,7 @@ void tst_qfxtextedit::color() { QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); @@ -384,7 +384,7 @@ void tst_qfxtextedit::color() QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->color(), testColor); @@ -396,7 +396,7 @@ void tst_qfxtextedit::selection() QString testStr = standard[0];//TODO: What should happen for multiline/rich text? QString componentStr = "import Qt 4.6\nTextEdit { text: \""+ testStr +"\"; }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); + QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); @@ -477,12 +477,12 @@ void tst_qfxtextedit::cursorDelegate() view->execute(); view->show(); view->setFocus(); - QFxTextEdit *textEditObject = view->root()->findChild<QFxTextEdit*>("textEditObject"); + QmlGraphicsTextEdit *textEditObject = view->root()->findChild<QmlGraphicsTextEdit*>("textEditObject"); QVERIFY(textEditObject != 0); - QVERIFY(textEditObject->findChild<QFxItem*>("cursorInstance")); + QVERIFY(textEditObject->findChild<QmlGraphicsItem*>("cursorInstance")); //Test Delegate gets created textEditObject->setFocus(true); - QFxItem* delegateObject = textEditObject->findChild<QFxItem*>("cursorInstance"); + QmlGraphicsItem* delegateObject = textEditObject->findChild<QmlGraphicsItem*>("cursorInstance"); QVERIFY(delegateObject); //Test Delegate gets moved for(int i=0; i<= textEditObject->text().length(); i++){ @@ -495,7 +495,7 @@ void tst_qfxtextedit::cursorDelegate() QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); //Test Delegate gets deleted textEditObject->setCursorDelegate(0); - QVERIFY(!textEditObject->findChild<QFxItem*>("cursorInstance")); + QVERIFY(!textEditObject->findChild<QmlGraphicsItem*>("cursorInstance")); } /* @@ -511,7 +511,7 @@ void tst_qfxtextedit::navigation() QVERIFY(canvas->root() != 0); - QFxItem *input = qobject_cast<QFxItem *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); + QmlGraphicsItem *input = qobject_cast<QmlGraphicsItem *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasFocus() == true); diff --git a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp index 277c33d..2dc096d 100644 --- a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp +++ b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp @@ -43,7 +43,7 @@ #include <QtDeclarative/qmlengine.h> #include <QFile> #include <QtDeclarative/qmlview.h> -#include <QFxTextInput> +#include <private/qmlgraphicstextinput_p.h> #include <QDebug> class tst_qfxtextinput : public QObject @@ -100,7 +100,7 @@ void tst_qfxtextinput::text() { { QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->text(), QString("")); @@ -110,7 +110,7 @@ void tst_qfxtextinput::text() { QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->text(), standard.at(i)); @@ -123,7 +123,7 @@ void tst_qfxtextinput::width() // uses Font metrics to find the width for standard { QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->width(), 1.);//1 for the cursor @@ -137,7 +137,7 @@ void tst_qfxtextinput::width() QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->width(), qreal(metricWidth) + 1.);//1 for the cursor @@ -150,7 +150,7 @@ void tst_qfxtextinput::font() { QString componentStr = "import Qt 4.6\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().pointSize(), 40); @@ -161,7 +161,7 @@ void tst_qfxtextinput::font() { QString componentStr = "import Qt 4.6\nTextInput { font.bold: true; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().bold(), true); @@ -171,7 +171,7 @@ void tst_qfxtextinput::font() { QString componentStr = "import Qt 4.6\nTextInput { font.italic: true; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().italic(), true); @@ -181,7 +181,7 @@ void tst_qfxtextinput::font() { QString componentStr = "import Qt 4.6\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().family(), QString("Helvetica")); @@ -192,7 +192,7 @@ void tst_qfxtextinput::font() { QString componentStr = "import Qt 4.6\nTextInput { font.family: \"\"; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().family(), QString("")); @@ -206,7 +206,7 @@ void tst_qfxtextinput::color() { QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); //qDebug() << "textinputObject: " << textinputObject->color() << "vs. " << QColor(colorStrings.at(i)); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); @@ -219,7 +219,7 @@ void tst_qfxtextinput::color() QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->color(), testColor); @@ -231,7 +231,7 @@ void tst_qfxtextinput::selection() QString testStr = standard[0]; QString componentStr = "import Qt 4.6\nTextInput { text: \""+ testStr +"\"; }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); @@ -310,7 +310,7 @@ void tst_qfxtextinput::maxLength() { QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QVERIFY(textinputObject->text().isEmpty()); foreach(const QString &str, standard){ @@ -325,7 +325,7 @@ void tst_qfxtextinput::masks() { QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); //TODO: Me @@ -335,7 +335,7 @@ void tst_qfxtextinput::validators() { QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QFxTextInput *textinputObject = qobject_cast<QFxTextInput*>(textinputComponent.create()); + QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); //TODO: Me @@ -354,7 +354,7 @@ void tst_qfxtextinput::navigation() QVERIFY(canvas->root() != 0); - QFxItem *input = qobject_cast<QFxItem *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); + QmlGraphicsItem *input = qobject_cast<QmlGraphicsItem *>(qvariant_cast<QObject *>(canvas->root()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasFocus() == true); @@ -374,12 +374,12 @@ void tst_qfxtextinput::cursorDelegate() view->execute(); view->show(); view->setFocus(); - QFxTextInput *textInputObject = view->root()->findChild<QFxTextInput*>("textInputObject"); + QmlGraphicsTextInput *textInputObject = view->root()->findChild<QmlGraphicsTextInput*>("textInputObject"); QVERIFY(textInputObject != 0); - QVERIFY(textInputObject->findChild<QFxItem*>("cursorInstance")); + QVERIFY(textInputObject->findChild<QmlGraphicsItem*>("cursorInstance")); //Test Delegate gets created textInputObject->setFocus(true); - QFxItem* delegateObject = textInputObject->findChild<QFxItem*>("cursorInstance"); + QmlGraphicsItem* delegateObject = textInputObject->findChild<QmlGraphicsItem*>("cursorInstance"); QVERIFY(delegateObject); //Test Delegate gets moved for(int i=0; i<= textInputObject->text().length(); i++){ @@ -393,7 +393,7 @@ void tst_qfxtextinput::cursorDelegate() QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); //Test Delegate gets deleted textInputObject->setCursorDelegate(0); - QVERIFY(!textInputObject->findChild<QFxItem*>("cursorInstance")); + QVERIFY(!textInputObject->findChild<QmlGraphicsItem*>("cursorInstance")); } void tst_qfxtextinput::simulateKey(QmlView *view, int key) diff --git a/tests/auto/declarative/qfxwebview/qfxwebview.pro b/tests/auto/declarative/qfxwebview/qfxwebview.pro index b75e057..cce3df2 100644 --- a/tests/auto/declarative/qfxwebview/qfxwebview.pro +++ b/tests/auto/declarative/qfxwebview/qfxwebview.pro @@ -2,7 +2,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative macx:CONFIG -= app_bundle -SOURCES += tst_qfxwebview.cpp +SOURCES += tst_qmlgraphicswebview.cpp # Define SRCDIR equal to test's source directory DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp index 45aa734..9ca6312 100644 --- a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp +++ b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp @@ -42,7 +42,7 @@ #include "../../../shared/util.h" #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxwebview.h> +#include <private/qmlgraphicswebview_p.h> #include <QtWebKit/qwebpage.h> #include <QtWebKit/qwebframe.h> #include <QtCore/qdir.h> @@ -108,7 +108,7 @@ void tst_qfxwebview::testBasicProperties() checkNoErrors(component); QWebSettings::enablePersistentStorage(tmpDir()); - QFxWebView *wv = qobject_cast<QFxWebView*>(component.create()); + QmlGraphicsWebView *wv = qobject_cast<QmlGraphicsWebView*>(component.create()); QVERIFY(wv != 0); QTRY_COMPARE(wv->progress(), 1.0); QCOMPARE(wv->title(),QString("Basic")); @@ -127,7 +127,7 @@ void tst_qfxwebview::testBasicProperties() QCOMPARE(wv->preferredWidth(), 0); QCOMPARE(wv->zoomFactor(), 1.0); QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html")); - QCOMPARE(wv->status(), QFxWebView::Ready); + QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); QVERIFY(wv->reloadAction()); QVERIFY(wv->reloadAction()->isEnabled()); QVERIFY(wv->backAction()); diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 7fa2f25..7dfb0ff 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -987,11 +987,11 @@ void tst_qmllanguage::importsLocal_data() QTest::newRow("local import") << "import \"subdir\"\n" // QT-613 "Test {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("local import as") << "import \"subdir\" as T\n" "T.Test {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("wrong local import as") << "import \"subdir\" as T\n" "Test {}" @@ -1019,9 +1019,9 @@ void tst_qmllanguage::importsRemote_data() + QtNetworkSettings::serverName() + "/qtest/declarative/qmllanguage"; - QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QFxRect"; - QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QFxText"; - QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QFxImage"; + QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QmlGraphicsRect"; + QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QmlGraphicsText"; + QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QmlGraphicsImage"; } void tst_qmllanguage::importsRemote() @@ -1042,11 +1042,11 @@ void tst_qmllanguage::importsInstalled_data() QTest::newRow("installed import 1") << "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("installed import 2") << "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << "QFxText"; + << "QmlGraphicsText"; QTest::newRow("installed import visibility") // QT-614 << "import com.nokia.installedtest 1.4\n" "PrivateType {}" @@ -1070,36 +1070,36 @@ void tst_qmllanguage::importsOrder_data() "import com.nokia.installedtest 1.0\n" "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << "QFxText"; + << "QmlGraphicsText"; QTest::newRow("installed import overrides 2") << "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("installed import re-overrides 1") << "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << "QFxText"; + << "QmlGraphicsText"; QTest::newRow("installed import re-overrides 2") << "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("installed import versus builtin 1") << "import com.nokia.installedtest 1.5\n" "import Qt 4.6\n" "Rectangle {}" - << "QFxRect"; + << "QmlGraphicsRect"; QTest::newRow("installed import versus builtin 2") << "import Qt 4.6\n" "import com.nokia.installedtest 1.5\n" "Rectangle {}" - << "QFxText"; + << "QmlGraphicsText"; QTest::newRow("namespaces cannot be overridden by types 1") << "import Qt 4.6 as Rectangle\n" "import com.nokia.installedtest 1.5\n" @@ -1109,7 +1109,7 @@ void tst_qmllanguage::importsOrder_data() "import Qt 4.6 as Rectangle\n" "import com.nokia.installedtest 1.5\n" "Rectangle.Image {}" - << "QFxImage"; + << "QmlGraphicsImage"; } void tst_qmllanguage::importsOrder() diff --git a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp index aee723f..b2d42ff 100644 --- a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp +++ b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <qtest.h> #include <QtDeclarative/qml.h> -#include <QtDeclarative/qmllistaccessor.h> +#include <private/qmllistaccessor_p.h> class tst_QmlListAccessor : public QObject { diff --git a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp index 407c09c..a7211bd 100644 --- a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp +++ b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp @@ -41,9 +41,9 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcontext.h> -#include <QtDeclarative/qmlpropertymap.h> +#include <private/qmlpropertymap_p.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxtext.h> +#include <private/qmlgraphicstext_p.h> #include <QSignalSpy> class tst_QmlPropertyMap : public QObject @@ -119,7 +119,7 @@ void tst_QmlPropertyMap::changed() QmlComponent component(&engine, "import Qt 4.6\nText { text: { testdata.key1 = 'Hello World'; 'X' } }", QUrl("file://")); QVERIFY(component.isReady()); - QFxText *txt = qobject_cast<QFxText*>(component.create()); + QmlGraphicsText *txt = qobject_cast<QmlGraphicsText*>(component.create()); QVERIFY(txt); QCOMPARE(txt->text(), QString('X')); QCOMPARE(spy.count(), 1); diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp index ecf8b25..d3b273c 100644 --- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp +++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp @@ -41,7 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qmltimer.h> +#include <private/qmltimer_p.h> class tst_qmltimer : public QObject { diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp index d58ab4a..dc0f1be 100644 --- a/tests/auto/declarative/repeater/tst_repeater.cpp +++ b/tests/auto/declarative/repeater/tst_repeater.cpp @@ -39,17 +39,17 @@ ** ****************************************************************************/ #include <QtTest/QtTest> -#include <qlistmodelinterface.h> +#include <private/qlistmodelinterface_p.h> #include <qmlview.h> -#include <qfxrepeater.h> -#include <qfxtext.h> +#include <private/qmlgraphicsrepeater_p.h> +#include <private/qmlgraphicstext_p.h> #include <qmlcontext.h> -class tst_QFxRepeater : public QObject +class tst_QmlGraphicsRepeater : public QObject { Q_OBJECT public: - tst_QFxRepeater(); + tst_QmlGraphicsRepeater(); private slots: void stringList(); @@ -60,7 +60,7 @@ private: T *findItem(QObject *parent, const QString &id); }; -tst_QFxRepeater::tst_QFxRepeater() +tst_QmlGraphicsRepeater::tst_QmlGraphicsRepeater() { } @@ -69,7 +69,7 @@ The Repeater element creates children at its own position in its parent's stacking order. In this test we insert a repeater between two other Text elements to test this. */ -void tst_QFxRepeater::stringList() +void tst_QmlGraphicsRepeater::stringList() { QmlView *canvas = createView(SRCDIR "/data/repeater.qml"); @@ -85,10 +85,10 @@ void tst_QFxRepeater::stringList() canvas->execute(); qApp->processEvents(); - QFxRepeater *repeater = findItem<QFxRepeater>(canvas->root(), "repeater"); + QmlGraphicsRepeater *repeater = findItem<QmlGraphicsRepeater>(canvas->root(), "repeater"); QVERIFY(repeater != 0); - QFxItem *container = findItem<QFxItem>(canvas->root(), "container"); + QmlGraphicsItem *container = findItem<QmlGraphicsItem>(canvas->root(), "container"); QVERIFY(container != 0); QCOMPARE(container->childItems().count(), data.count() + 3); @@ -97,21 +97,21 @@ void tst_QFxRepeater::stringList() for (int i = 0; i < container->childItems().count(); ++i) { if (i == 0) { - QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i)); + QmlGraphicsText *name = qobject_cast<QmlGraphicsText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), QLatin1String("Zero")); } else if (i == container->childItems().count() - 2) { // The repeater itself - QFxRepeater *rep = qobject_cast<QFxRepeater*>(container->childItems().at(i)); + QmlGraphicsRepeater *rep = qobject_cast<QmlGraphicsRepeater*>(container->childItems().at(i)); QCOMPARE(rep, repeater); saw_repeater = true; continue; } else if (i == container->childItems().count() - 1) { - QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i)); + QmlGraphicsText *name = qobject_cast<QmlGraphicsText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), QLatin1String("Last")); } else { - QFxText *name = qobject_cast<QFxText*>(container->childItems().at(i)); + QmlGraphicsText *name = qobject_cast<QmlGraphicsText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), data.at(i-1)); } @@ -122,7 +122,7 @@ void tst_QFxRepeater::stringList() } -QmlView *tst_QFxRepeater::createView(const QString &filename) +QmlView *tst_QmlGraphicsRepeater::createView(const QString &filename) { QmlView *canvas = new QmlView(0); canvas->setFixedSize(240,320); @@ -136,13 +136,13 @@ QmlView *tst_QFxRepeater::createView(const QString &filename) } template<typename T> -T *tst_QFxRepeater::findItem(QObject *parent, const QString &objectName) +T *tst_QmlGraphicsRepeater::findItem(QObject *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; if (mo.cast(parent) && (objectName.isEmpty() || parent->objectName() == objectName)) return static_cast<T*>(parent); for (int i = 0; i < parent->children().count(); ++i) { - QFxItem *item = findItem<T>(parent->children().at(i), objectName); + QmlGraphicsItem *item = findItem<T>(parent->children().at(i), objectName); if (item) return static_cast<T*>(item); } @@ -150,6 +150,6 @@ T *tst_QFxRepeater::findItem(QObject *parent, const QString &objectName) return 0; } -QTEST_MAIN(tst_QFxRepeater) +QTEST_MAIN(tst_QmlGraphicsRepeater) #include "tst_repeater.moc" diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp index 338d8fe..8d52eb4 100644 --- a/tests/auto/declarative/sql/tst_sql.cpp +++ b/tests/auto/declarative/sql/tst_sql.cpp @@ -42,7 +42,7 @@ #include "../../../shared/util.h" #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxtext.h> +#include <private/qmlgraphicstext_p.h> #include <QtWebKit/qwebpage.h> #include <QtWebKit/qwebframe.h> #include <QtWebKit/qwebdatabase.h> @@ -197,7 +197,7 @@ void tst_sql::testQml() engine->setOfflineStoragePath(dbDir()); QmlComponent component(engine, qml.toUtf8(), QUrl::fromLocalFile(SRCDIR "/empty.qml")); // just a file for relative local imports - QFxText *text = qobject_cast<QFxText*>(component.create()); + QmlGraphicsText *text = qobject_cast<QmlGraphicsText*>(component.create()); QVERIFY(text != 0); QCOMPARE(text->text(),result); QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), databases*2); // *2 = .ini file + .sqlite file diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index 7d59b36..4425eac 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -41,7 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qfxrect.h> +#include <private/qmlgraphicsrect_p.h> class tst_states : public QObject { @@ -62,7 +62,7 @@ void tst_states::basicChanges() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -76,7 +76,7 @@ void tst_states::basicChanges() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicChanges2.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -96,7 +96,7 @@ void tst_states::basicChanges() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicChanges3.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -132,7 +132,7 @@ void tst_states::basicExtension() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicExtension.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -165,7 +165,7 @@ void tst_states::basicExtension() { QmlComponent rectComponent(&engine, SRCDIR "/data/fakeExtension.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -196,7 +196,7 @@ void tst_states::basicBinding() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicBinding.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -223,7 +223,7 @@ void tst_states::basicBinding() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicBinding2.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -253,7 +253,7 @@ void tst_states::basicBinding() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicBinding3.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -277,7 +277,7 @@ void tst_states::basicBinding() { QmlComponent rectComponent(&engine, SRCDIR "/data/basicBinding4.qml"); - QFxRect *rect = qobject_cast<QFxRect*>(rectComponent.create()); + QmlGraphicsRect *rect = qobject_cast<QmlGraphicsRect*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -303,7 +303,7 @@ void tst_states::basicBinding() } } -class MyRect : public QFxRect +class MyRect : public QmlGraphicsRect { Q_OBJECT public: @@ -343,7 +343,7 @@ void tst_states::signalOverride() rect->doSomething(); QCOMPARE(rect->color(),QColor("blue")); - QFxRect *innerRect = qobject_cast<QFxRect*>(rect->findChild<QFxRect*>("extendedRect")); + QmlGraphicsRect *innerRect = qobject_cast<QmlGraphicsRect*>(rect->findChild<QmlGraphicsRect*>("extendedRect")); innerRect->setState("green"); rect->doSomething(); |