diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-05-08 03:33:37 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-05-08 03:33:37 (GMT) |
commit | 2ce79831de76b32ef2b0b96aef7301a83cdcf73a (patch) | |
tree | 375ed90127a42bb00e6f0cfc1b30c5357570db8d | |
parent | 009e825d2da38b95fb2efbfbdefc4b58c8bf0fa8 (diff) | |
download | Qt-2ce79831de76b32ef2b0b96aef7301a83cdcf73a.zip Qt-2ce79831de76b32ef2b0b96aef7301a83cdcf73a.tar.gz Qt-2ce79831de76b32ef2b0b96aef7301a83cdcf73a.tar.bz2 |
Get autotests compiling again. Start converting syntax.
13 files changed, 69 insertions, 69 deletions
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index b76235b..549c9c2 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -90,7 +90,6 @@ private: QML_DECLARE_TYPE(QFxContents); Q_DECLARE_OPERATORS_FOR_FLAGS(QFxAnchors::UsedAnchors); -class QmlContext; class QmlState; class QmlTransition; class QFxTransform; diff --git a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp index 4593033..67cff02 100644 --- a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp +++ b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp @@ -18,7 +18,7 @@ private slots: void tst_datetimeformatter::date() { QmlEngine engine; - QmlComponent formatterComponent(&engine, "<DateTimeFormatter date=\"2008-12-24\"/>"); + QmlComponent formatterComponent(&engine, "DateTimeFormatter { date: \"2008-12-24\" }"); QmlDateTimeFormatter *formatter = qobject_cast<QmlDateTimeFormatter*>(formatterComponent.create()); QVERIFY(formatter != 0); @@ -38,7 +38,7 @@ void tst_datetimeformatter::date() void tst_datetimeformatter::time() { QmlEngine engine; - QmlComponent formatterComponent(&engine, "<DateTimeFormatter time=\"14:15:38.200\"/>"); + QmlComponent formatterComponent(&engine, "DateTimeFormatter { time: \"14:15:38.200\" }"); QmlDateTimeFormatter *formatter = qobject_cast<QmlDateTimeFormatter*>(formatterComponent.create()); QVERIFY(formatter != 0); @@ -64,7 +64,7 @@ void tst_datetimeformatter::time() void tst_datetimeformatter::dateTime() { QmlEngine engine; - QmlComponent formatterComponent(&engine, "<DateTimeFormatter dateTime=\"1978-03-04T09:13:54\"/>"); + QmlComponent formatterComponent(&engine, "DateTimeFormatter { dateTime: \"1978-03-04T09:13:54\" }"); QmlDateTimeFormatter *formatter = qobject_cast<QmlDateTimeFormatter*>(formatterComponent.create()); QVERIFY(formatter != 0); diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index ad6a0b2..3fc4678 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -354,7 +354,7 @@ QFxView *tst_QFxLayouts::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); QString xml = file.readAll(); - canvas->setXml(xml, filename); + canvas->setQml(xml, filename); return canvas; } @@ -371,7 +371,7 @@ T *tst_QFxLayouts::findItem(QFxItem *parent, const QString &id, int index) QFxItem *item = parent->children()->at(i); if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { if (index != -1) { - QmlExpression e(item->itemContext(), "index", item); + QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); if (e.value().toInt() == index) return static_cast<T*>(item); diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 681af57..25f546a 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -446,7 +446,7 @@ QFxView *tst_QFxListView::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); QString xml = file.readAll(); - canvas->setXml(xml, filename); + canvas->setQml(xml, filename); return canvas; } @@ -463,7 +463,7 @@ T *tst_QFxListView::findItem(QFxItem *parent, const QString &id, int index) QFxItem *item = parent->children()->at(i); if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { if (index != -1) { - QmlExpression e(item->itemContext(), "index", item); + QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); if (e.value().toInt() == index) return static_cast<T*>(item); diff --git a/tests/auto/declarative/namespaces/tst_namespaces.cpp b/tests/auto/declarative/namespaces/tst_namespaces.cpp index 665651d..e9529ff 100644 --- a/tests/auto/declarative/namespaces/tst_namespaces.cpp +++ b/tests/auto/declarative/namespaces/tst_namespaces.cpp @@ -57,7 +57,7 @@ void tst_namespaces::simple() QFxView canvas(0); canvas.rootContext()->engine()->addNameSpacePath("http://nokia.com/qml", SRCDIR "/data"); - canvas.setXml(qml); + canvas.setQml(qml); canvas.execute(); qApp->processEvents(); diff --git a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp index eaeab51..e70d651 100644 --- a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp +++ b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp @@ -165,7 +165,7 @@ void tst_numberformat::number() QFETCH(QString, string); QFETCH(float, number); - QString componentStr = QString("<NumberFormatter number=\"") + string + QString("\"/>"); + QString componentStr = QString("NumberFormatter { number: \"") + string + QString("\" }"); QmlEngine engine; QmlComponent formatterComponent(&engine, componentStr.toAscii()); @@ -200,7 +200,7 @@ void tst_numberformat::text() QFETCH(QString, format); QFETCH(QString, text); - QString componentStr = QString("<NumberFormatter number=\"") + string + QString("\" format=\"") + format + QString("\" />"); + QString componentStr = QString("NumberFormatter { number: \"") + string + QString("\"; format: \"") + format + QString("\" }"); QmlEngine engine; QmlComponent formatterComponent(&engine, componentStr.toAscii()); diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp index 110d129..92890ba 100644 --- a/tests/auto/declarative/pathview/tst_pathview.cpp +++ b/tests/auto/declarative/pathview/tst_pathview.cpp @@ -221,7 +221,7 @@ QFxView *tst_QFxPathView::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); QString xml = file.readAll(); - canvas->setXml(xml, filename); + canvas->setQml(xml, filename); return canvas; } @@ -238,7 +238,7 @@ T *tst_QFxPathView::findItem(QFxItem *parent, const QString &id, int index) QFxItem *item = parent->children()->at(i); if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { if (index != -1) { - QmlExpression e(item->itemContext(), "index", item); + QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); if (e.value().toInt() == index) return static_cast<T*>(item); diff --git a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp index da58857..a8046e6 100644 --- a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp +++ b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp @@ -59,7 +59,7 @@ void tst_QBindableMap::changed() QmlEngine engine; QmlContext *ctxt = engine.rootContext(); ctxt->setContextProperty(QLatin1String("data"), &map); - QmlComponent component(&engine, "<Script script=\"data.key1 = 'Hello World';\"/>"); + QmlComponent component(&engine, "Script { script: \"data.key1 = 'Hello World';\" }"); component.create(); QCOMPARE(spy.count(), 1); QList<QVariant> arguments = spy.takeFirst(); diff --git a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp index ee74040..0eb9f97 100644 --- a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp +++ b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp @@ -48,8 +48,8 @@ tst_qfxtext::tst_qfxtext() standard << "the quick brown fox jumped over the lazy dog" << "the quick brown fox\n jumped over the lazy dog"; - richText << "<i>the <b>quick</b> brown <a href=\"http://www.google.com\">fox</a> jumped over the <b>lazy</b> dog</i>" - << "<i>the <b>quick</b> brown <a href=\"http://www.google.com\">fox</a><br>jumped over the <b>lazy</b> dog</i>"; + richText << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a> jumped over the <b>lazy</b> dog</i>" + << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a><br>jumped over the <b>lazy</b> dog</i>"; hAlignmentStrings << "AlignLeft" << "AlignRight" @@ -99,7 +99,7 @@ tst_qfxtext::tst_qfxtext() void tst_qfxtext::text() { { - QmlComponent textComponent(&engine, "<Text text=\"\" />"); + QmlComponent textComponent(&engine, "Text { text: \"\" }"); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); QVERIFY(textObject != 0); @@ -108,7 +108,7 @@ void tst_qfxtext::text() for (int i = 0; i < standard.size(); i++) { - QString componentStr = "<Text>" + standard.at(i) + "</Text>"; + QString componentStr = "Text { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -118,12 +118,13 @@ void tst_qfxtext::text() for (int i = 0; i < richText.size(); i++) { - QString componentStr = "<Text><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); QVERIFY(textObject != 0); - QCOMPARE(textObject->text(), richText.at(i)); + QString expected = richText.at(i); + QCOMPARE(textObject->text(), expected.replace("\\\"", "\"")); } } @@ -131,7 +132,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, "<Text text=\"\"/>"); + QmlComponent textComponent(&engine, "Text { text: \"\" }"); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); QCOMPARE(textObject->width(), 0.); @@ -143,7 +144,7 @@ void tst_qfxtext::width() QFontMetrics fm(f); int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - QString componentStr = "<Text>" + standard.at(i) + "</Text>"; + QString componentStr = "Text { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -158,7 +159,7 @@ void tst_qfxtext::width() int documentWidth = document.idealWidth(); - QString componentStr = "<Text><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -172,7 +173,7 @@ void tst_qfxtext::wrap() // for specified width and wrap set true { - QmlComponent textComponent(&engine, "<Text text=\"\" wrap=\"true\" width=\"300\"/>"); + QmlComponent textComponent(&engine, "Text { text: \"\"; wrap: true; width: 300 }"); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); @@ -180,7 +181,7 @@ void tst_qfxtext::wrap() for (int i = 0; i < standard.size(); i++) { - QString componentStr = "<Text wrap=\"true\" width=\"300\">" + standard.at(i) + "</Text>"; + QString componentStr = "Text { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -189,7 +190,7 @@ void tst_qfxtext::wrap() for (int i = 0; i < richText.size(); i++) { - QString componentStr = "<Text wrap=\"true\" width=\"300\"><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -202,12 +203,12 @@ void tst_qfxtext::elide() { for (Qt::TextElideMode m = Qt::ElideLeft; m<=Qt::ElideNone; m=Qt::TextElideMode(int(m)+1)) { const char* elidename[]={"ElideLeft", "ElideRight", "ElideMiddle", "ElideNone"}; - QString elide = "elide=\""+QString(elidename[int(m)])+"\""; + QString elide = "elide: \""+QString(elidename[int(m)])+"\";"; // XXX Poor coverage. { - QmlComponent textComponent(&engine, ("<Text text=\"\" "+elide+" width=\"300\"/>").toLatin1()); + QmlComponent textComponent(&engine, ("Text { text: \"\"; "+elide+" width: 300 }").toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); QCOMPARE(textObject->width(), 300.); @@ -215,7 +216,7 @@ void tst_qfxtext::elide() for (int i = 0; i < standard.size(); i++) { - QString componentStr = "<Text "+elide+" width=\"300\">" + standard.at(i) + "</Text>"; + QString componentStr = "Text { "+elide+" width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -225,7 +226,7 @@ void tst_qfxtext::elide() // richtext - does nothing for (int i = 0; i < richText.size(); i++) { - QString componentStr = "<Text "+elide+" width=\"300\"><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { "+elide+" width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -243,7 +244,7 @@ void tst_qfxtext::hAlign() { for (int j=0; j < hAlignmentStrings.size(); j++) { - QString componentStr = "<Text hAlign=\"" + hAlignmentStrings.at(j) + "\">" + standard.at(i) + "</Text>"; + QString componentStr = "Text { hAlign: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -255,7 +256,7 @@ void tst_qfxtext::hAlign() { for (int j=0; j < hAlignmentStrings.size(); j++) { - QString componentStr = "<Text hAlign=\"" + hAlignmentStrings.at(j) + "\"><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { hAlign: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -273,7 +274,7 @@ void tst_qfxtext::vAlign() { for (int j=0; j < vAlignmentStrings.size(); j++) { - QString componentStr = "<Text vAlign=\"" + vAlignmentStrings.at(j) + "\">" + standard.at(i) + "</Text>"; + QString componentStr = "Text { vAlign: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -285,7 +286,7 @@ void tst_qfxtext::vAlign() { for (int j=0; j < vAlignmentStrings.size(); j++) { - QString componentStr = "<Text vAlign=\"" + vAlignmentStrings.at(j) + "\"><![CDATA[" + richText.at(i) + "]]></Text>"; + QString componentStr = "Text { vAlign: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -299,7 +300,7 @@ void tst_qfxtext::font() { //test size, then bold, then italic, then family { - QString componentStr = "<Text font.size=\"40\" text=\"Hello World\"/>"; + QString componentStr = "Text { font.size: 40; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -309,7 +310,7 @@ void tst_qfxtext::font() } { - QString componentStr = "<Text font.bold=\"true\" text=\"Hello World\"/>"; + QString componentStr = "Text { font.bold: true; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -318,7 +319,7 @@ void tst_qfxtext::font() } { - QString componentStr = "<Text font.italic=\"true\" text=\"Hello World\"/>"; + QString componentStr = "Text { font.italic: true; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -327,7 +328,7 @@ void tst_qfxtext::font() } { - QString componentStr = "<Text font.family=\"Helvetica\" text=\"Hello World\"/>"; + QString componentStr = "Text { font.family: \"Helvetica\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -337,7 +338,7 @@ void tst_qfxtext::font() } { - QString componentStr = "<Text font.family=\"\" text=\"Hello World\"/>"; + QString componentStr = "Text { font.family: \"\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -350,7 +351,7 @@ void tst_qfxtext::style() //test style for (int i = 0; i < styles.size(); i++) { - QString componentStr = "<Text style=\"" + styleStrings.at(i) + "\" text=\"Hello World\"/>"; + QString componentStr = "Text { style: \"" + styleStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -364,7 +365,7 @@ void tst_qfxtext::color() //test style for (int i = 0; i < colorStrings.size(); i++) { - QString componentStr = "<Text color=\"" + colorStrings.at(i) + "\" text=\"Hello World\"/>"; + QString componentStr = "Text { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -374,7 +375,7 @@ void tst_qfxtext::color() for (int i = 0; i < colorStrings.size(); i++) { - QString componentStr = "<Text styleColor=\"" + colorStrings.at(i) + "\" text=\"Hello World\"/>"; + QString componentStr = "Text { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -387,7 +388,7 @@ void tst_qfxtext::color() { for (int j = 0; j < colorStrings.size(); j++) { - QString componentStr = "<Text color=\"" + colorStrings.at(i) + "\" styleColor=\"" + colorStrings.at(j) + "\" text=\"Hello World\"/>"; + QString componentStr = "Text { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); @@ -400,7 +401,7 @@ void tst_qfxtext::color() QColor testColor("#001234"); testColor.setAlpha(170); - QString componentStr = "<Text color=\"" + colorStr + "\" text=\"Hello World\"/>"; + QString componentStr = "Text { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1()); QFxText *textObject = qobject_cast<QFxText*>(textComponent.create()); diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp index 8baef3d..7be5b50 100644 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp @@ -43,8 +43,8 @@ tst_qfxtextedit::tst_qfxtextedit() standard << "the quick brown fox jumped over the lazy dog" << "the quick brown fox\n jumped over the lazy dog"; - richText << "<i>the <b>quick</b> brown <a href=\"http://www.google.com\">fox</a> jumped over the <b>lazy</b> dog</i>" - << "<i>the <b>quick</b> brown <a href=\"http://www.google.com\">fox</a><br>jumped over the <b>lazy</b> dog</i>"; + richText << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a> jumped over the <b>lazy</b> dog</i>" + << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a><br>jumped over the <b>lazy</b> dog</i>"; hAlignmentStrings << "AlignLeft" << "AlignRight" @@ -84,7 +84,7 @@ tst_qfxtextedit::tst_qfxtextedit() void tst_qfxtextedit::text() { { - QmlComponent texteditComponent(&engine, "<TextEdit text=\"\" />"); + QmlComponent texteditComponent(&engine, "TextEdit { text: \"\" }"); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); @@ -93,7 +93,7 @@ void tst_qfxtextedit::text() for (int i = 0; i < standard.size(); i++) { - QString componentStr = "<TextEdit>" + standard.at(i) + "</TextEdit>"; + QString componentStr = "TextEdit { text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -103,7 +103,7 @@ void tst_qfxtextedit::text() for (int i = 0; i < richText.size(); i++) { - QString componentStr = "<TextEdit><![CDATA[" + richText.at(i) + "]]></TextEdit>"; + QString componentStr = "TextEdit { text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -121,7 +121,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, "<TextEdit text=\"\"/>"); + QmlComponent texteditComponent(&engine, "TextEdit { text: \"\" }"); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); QCOMPARE(textEditObject->width(), 0.); @@ -133,7 +133,7 @@ void tst_qfxtextedit::width() QFontMetrics fm(f); int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - QString componentStr = "<TextEdit>" + standard.at(i) + "</TextEdit>"; + QString componentStr = "TextEdit { text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -148,7 +148,7 @@ void tst_qfxtextedit::width() int documentWidth = document.idealWidth(); - QString componentStr = "<TextEdit><![CDATA[" + richText.at(i) + "]]></TextEdit>"; + QString componentStr = "TextEdit { text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -160,7 +160,7 @@ void tst_qfxtextedit::wrap() { // for specified width and wrap set true { - QmlComponent texteditComponent(&engine, "<TextEdit text=\"\" wrap=\"true\" width=\"300\"/>"); + QmlComponent texteditComponent(&engine, "TextEdit { text: \"\"; wrap: true; width: 300 }"); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); QCOMPARE(textEditObject->width(), 300.); @@ -168,7 +168,7 @@ void tst_qfxtextedit::wrap() for (int i = 0; i < standard.size(); i++) { - QString componentStr = "<TextEdit wrap=\"true\" width=\"300\">" + standard.at(i) + "</TextEdit>"; + QString componentStr = "TextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -177,7 +177,7 @@ void tst_qfxtextedit::wrap() for (int i = 0; i < richText.size(); i++) { - QString componentStr = "<TextEdit wrap=\"true\" width=\"300\"><![CDATA[" + richText.at(i) + "]]></TextEdit>"; + QString componentStr = "TextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -195,7 +195,7 @@ void tst_qfxtextedit::hAlign() { for (int j=0; j < hAlignmentStrings.size(); j++) { - QString componentStr = "<TextEdit hAlign=\"" + hAlignmentStrings.at(j) + "\">" + standard.at(i) + "</TextEdit>"; + QString componentStr = "TextEdit { hAlign: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -207,7 +207,7 @@ void tst_qfxtextedit::hAlign() { for (int j=0; j < hAlignmentStrings.size(); j++) { - QString componentStr = "<TextEdit hAlign=\"" + hAlignmentStrings.at(j) + "\"><![CDATA[" + richText.at(i) + "]]></TextEdit>"; + QString componentStr = "TextEdit { hAlign: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -225,7 +225,7 @@ void tst_qfxtextedit::vAlign() { for (int j=0; j < vAlignmentStrings.size(); j++) { - QString componentStr = "<TextEdit vAlign=\"" + vAlignmentStrings.at(j) + "\">" + standard.at(i) + "</TextEdit>"; + QString componentStr = "TextEdit { vAlign: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -237,7 +237,7 @@ void tst_qfxtextedit::vAlign() { for (int j=0; j < vAlignmentStrings.size(); j++) { - QString componentStr = "<TextEdit vAlign=\"" + vAlignmentStrings.at(j) + "\"><![CDATA[" + richText.at(i) + "]]></TextEdit>"; + QString componentStr = "TextEdit { vAlign: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -251,7 +251,7 @@ void tst_qfxtextedit::font() { //test size, then bold, then italic, then family { - QString componentStr = "<TextEdit font.size=\"40\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { font.size: 40; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -261,7 +261,7 @@ void tst_qfxtextedit::font() } { - QString componentStr = "<TextEdit font.bold=\"true\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { font.bold: true; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -270,7 +270,7 @@ void tst_qfxtextedit::font() } { - QString componentStr = "<TextEdit font.italic=\"true\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { font.italic: true; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -279,7 +279,7 @@ void tst_qfxtextedit::font() } { - QString componentStr = "<TextEdit font.family=\"Helvetica\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -289,7 +289,7 @@ void tst_qfxtextedit::font() } { - QString componentStr = "<TextEdit font.family=\"\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { font.family: \"\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); @@ -302,7 +302,7 @@ void tst_qfxtextedit::color() //test style for (int i = 0; i < colorStrings.size(); i++) { - QString componentStr = "<TextEdit color=\"" + colorStrings.at(i) + "\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); @@ -314,7 +314,7 @@ void tst_qfxtextedit::color() QColor testColor("#001234"); testColor.setAlpha(170); - QString componentStr = "<TextEdit color=\"" + colorStr + "\" text=\"Hello World\"/>"; + QString componentStr = "TextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1()); QFxTextEdit *textEditObject = qobject_cast<QFxTextEdit*>(texteditComponent.create()); diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp index 3a87070..1163dda 100644 --- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp +++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp @@ -1,5 +1,5 @@ #include <qtest.h> -#include <QtDeclarative/QmlEngine.h> +#include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlmetaproperty.h> #include <QtGui/QLineEdit> diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp index cdf1716..0d3ec98 100644 --- a/tests/auto/declarative/repeater/tst_repeater.cpp +++ b/tests/auto/declarative/repeater/tst_repeater.cpp @@ -66,7 +66,7 @@ QFxView *tst_QFxRepeater::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); QString xml = file.readAll(); - canvas->setXml(xml, filename); + canvas->setQml(xml, filename); return canvas; } diff --git a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp index 47608a0..4098a28 100644 --- a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp +++ b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp @@ -69,7 +69,7 @@ QFxView *tst_SimpleCanvasItem::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); QString xml = file.readAll(); - canvas->setXml(xml, filename); + canvas->setQml(xml, filename); return canvas; } |