diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-06-15 05:23:28 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-06-15 05:23:28 (GMT) |
commit | b18a343cc63f93a8e97a8c6c623e56a666775b57 (patch) | |
tree | 7a35d17235f26ed971f4367756a280ebfbc8e6a3 /tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp | |
parent | 7390cfbcbd5000a7da3eb5dbef790d114b06d042 (diff) | |
download | Qt-b18a343cc63f93a8e97a8c6c623e56a666775b57.zip Qt-b18a343cc63f93a8e97a8c6c623e56a666775b57.tar.gz Qt-b18a343cc63f93a8e97a8c6c623e56a666775b57.tar.bz2 |
Fix bug with childrenRect resizing on startup.
This also optimizes the implementation.
Task-number: QTBUG-11383
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index c2d3660..0a66245 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -72,6 +72,7 @@ private slots: void transforms(); void transforms_data(); void childrenRect(); + void childrenRectBug(); void childrenProperty(); void resourcesProperty(); @@ -736,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) { |