summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index ecc813e..0a66245 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -47,6 +47,11 @@
#include <QtDeclarative/qdeclarativeitem.h>
#include "../../../shared/util.h"
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
class tst_QDeclarativeItem : public QObject
{
@@ -67,6 +72,7 @@ private slots:
void transforms();
void transforms_data();
void childrenRect();
+ void childrenRectBug();
void childrenProperty();
void resourcesProperty();
@@ -731,6 +737,22 @@ void tst_QDeclarativeItem::childrenRect()
delete o;
}
+// QTBUG-11383
+void tst_QDeclarativeItem::childrenRectBug()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug.qml"));
+ canvas->show();
+
+ QGraphicsObject *o = canvas->rootObject();
+ QDeclarativeItem *item = o->findChild<QDeclarativeItem*>("theItem");
+ QCOMPARE(item->width(), qreal(200));
+ QCOMPARE(item->height(), qreal(100));
+ QCOMPARE(item->x(), qreal(100));
+
+ delete canvas;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
{