summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qfxtext/tst_qfxtext.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-30 04:15:22 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-30 04:15:22 (GMT)
commit45cc1ea534640cb492bd00405bf8fcd5dbfbcf5c (patch)
tree9bbf0cca7e26abfab486c658cc6d4005fd4e74b8 /tests/auto/declarative/qfxtext/tst_qfxtext.cpp
parentf37e9d787bd418d8f75997a8d46c1c42e842c673 (diff)
downloadQt-45cc1ea534640cb492bd00405bf8fcd5dbfbcf5c.zip
Qt-45cc1ea534640cb492bd00405bf8fcd5dbfbcf5c.tar.gz
Qt-45cc1ea534640cb492bd00405bf8fcd5dbfbcf5c.tar.bz2
Rename QFx classes to QmlGraphics
Diffstat (limited to 'tests/auto/declarative/qfxtext/tst_qfxtext.cpp')
-rw-r--r--tests/auto/declarative/qfxtext/tst_qfxtext.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp
index cae85a4..12cac68 100644
--- a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp
+++ b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp
@@ -36,7 +36,7 @@ private:
QList<Qt::Alignment> horizontalAlignmentments;
QStringList styleStrings;
- QList<QFxText::TextStyle> styles;
+ QList<QmlGraphicsText::TextStyle> styles;
QStringList colorStrings;
@@ -72,10 +72,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"
@@ -100,7 +100,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(""));
@@ -110,7 +110,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));
@@ -120,7 +120,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);
@@ -133,7 +133,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.);
}
@@ -146,7 +146,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));
}
@@ -161,7 +161,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));
}
@@ -174,7 +174,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.);
}
@@ -183,7 +183,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.);
}
@@ -192,7 +192,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.);
}
@@ -209,7 +209,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.);
}
@@ -218,7 +218,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.);
}
@@ -228,7 +228,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.);
}
@@ -246,7 +246,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));
}
@@ -258,7 +258,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));
}
@@ -276,7 +276,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));
}
@@ -288,7 +288,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));
}
@@ -302,7 +302,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);
@@ -312,7 +312,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);
@@ -321,7 +321,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);
@@ -330,7 +330,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);
@@ -340,7 +340,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(""));
}
@@ -353,7 +353,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());
@@ -367,7 +367,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());
@@ -377,7 +377,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?
@@ -390,7 +390,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)));
@@ -403,7 +403,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);
}