summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-09-28 03:55:04 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-09-28 22:43:21 (GMT)
commit085a121cb1ebba38d62c924500dbc71806b29b3c (patch)
tree90702eb46ef0f2c12919860c4492675843c37671 /tests
parent2784fe7be27afd80f6da69a683ed7aec91734de8 (diff)
downloadQt-085a121cb1ebba38d62c924500dbc71806b29b3c.zip
Qt-085a121cb1ebba38d62c924500dbc71806b29b3c.tar.gz
Qt-085a121cb1ebba38d62c924500dbc71806b29b3c.tar.bz2
Fix crash when trying to append a null transform to QDeclarativeItem.
Task-number: QTBUG-13893
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp12
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml b/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml
new file mode 100644
index 0000000..ab7fa84
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml
@@ -0,0 +1,13 @@
+import Qt 4.7
+
+Item {
+ id: wrapper
+ width: 200
+ height: 200
+
+ QtObject {
+ id: object
+ }
+
+ Component.onCompleted: wrapper.transform = object
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 25ca157..6b28c53 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -81,6 +81,8 @@ private slots:
void resourcesProperty();
void mouseFocus();
+ void transformCrash();
+
private:
template<typename T>
T *findItem(QGraphicsObject *parent, const QString &objectName);
@@ -792,6 +794,16 @@ void tst_QDeclarativeItem::childrenRectBug3()
delete canvas;
}
+// QTBUG-13893
+void tst_QDeclarativeItem::transformCrash()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/transformCrash.qml"));
+ canvas->show();
+
+ delete canvas;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
{