summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml29
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp13
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
new file mode 100644
index 0000000..5eccdda
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
@@ -0,0 +1,29 @@
+import Qt 4.7
+
+Rectangle {
+ width: 1024
+ height: 768
+
+ Item {
+ id: area
+ objectName: "area"
+ property int numx: 6
+ property int cellwidth: 1024/numx
+
+ onWidthChanged: {
+ width = width>1024?1024:width;
+ }
+
+ state: 'minimal'
+ states: [
+ State {
+ name: 'minimal'
+ PropertyChanges {
+ target: area
+ width: cellwidth
+ }
+ }
+ ]
+
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 0d10c10..b8409a5 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -143,6 +143,7 @@ private slots:
void returnToBase();
void extendsBug();
void editProperties();
+ void QTBUG_14830();
};
void tst_qdeclarativestates::initTestCase()
@@ -1375,6 +1376,18 @@ void tst_qdeclarativestates::editProperties()
QCOMPARE(childRect->height(), qreal(40));
}
+void tst_qdeclarativestates::QTBUG_14830()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/QTBUG-14830.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("area");
+
+ QCOMPARE(item->width(), qreal(171));
+}
+
QTEST_MAIN(tst_qdeclarativestates)
#include "tst_qdeclarativestates.moc"