summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-02-22 12:16:50 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-22 09:34:41 +0100
commit3dd45840c881e90904781169bfd546e1f58eac30 (patch)
treecf74fdb247a56da8381a4e78548174d5bbe01eb1 /tests
parent136f2352f67eedc12a719aa239594a204c3ee5a7 (diff)
Positioners cleanup
Use qreal for positions and spacing instead of ints, and make the positionedItems list take care of filtering out invisible items. Change-Id: Icad93ad89c848e40a70bd7a9539bd810e27020df Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp4
-rw-r--r--tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp28
2 files changed, 14 insertions, 18 deletions
diff --git a/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp b/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp
index d046f4e0a4..8d82abc53b 100644
--- a/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp
+++ b/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp
@@ -459,10 +459,6 @@ void tst_qquickanchors::crash1()
{
QUrl source(testFileUrl("crash1.qml"));
- QString expect = source.toString() + ":3:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.";
-
- QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
-
QQuickView *view = new QQuickView(source);
qApp->processEvents();
diff --git a/tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp
index a9c289c8de..4c903ab704 100644
--- a/tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp
@@ -1179,93 +1179,93 @@ void tst_qquickpositioners::test_conflictinganchors()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 2.0\nColumn { Item {} }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nColumn { Item { width: 100; height: 100; } }", QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
delete item;
- component.setData("import QtQuick 2.0\nRow { Item {} }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nRow { Item { width: 100; height: 100; } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
delete item;
- component.setData("import QtQuick 2.0\nGrid { Item {} }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nGrid { Item { width: 100; height: 100; } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
delete item;
- component.setData("import QtQuick 2.0\nFlow { Item {} }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nFlow { Item { width: 100; height: 100; } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
delete item;
- component.setData("import QtQuick 2.0\nColumn { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nColumn { Item { width: 100; height: 100; anchors.top: parent.top } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nColumn { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nColumn { Item { width: 100; height: 100; anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nColumn { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nColumn { Item { width: 100; height: 100; anchors.left: parent.left } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nRow { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nRow { Item { width: 100; height: 100; anchors.left: parent.left } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nRow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nRow { width: 100; height: 100; Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nRow { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nRow { Item { width: 100; height: 100; anchors.top: parent.top } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QVERIFY(warningMessage.isEmpty());
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nGrid { Item { anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nGrid { Item { width: 100; height: 100; anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nGrid { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nGrid { Item { width: 100; height: 100; anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
warningMessage.clear();
delete item;
- component.setData("import QtQuick 2.0\nFlow { Item { anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nFlow { Item { width: 100; height: 100; anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));
delete item;
- component.setData("import QtQuick 2.0\nFlow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0\nFlow { width: 100; height: 100; Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));