summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-04 13:00:50 +1000
committerMartin Jones <martin.jones@nokia.com>2010-11-04 13:00:50 +1000
commitf1344a817fdb3d263bd64f4440fedc73ad94ad31 (patch)
tree2c994ffa7eb940319b468cacf2ecc20525e5cdaa /tests
parent5ab0ad47ba216c851c21d7fee73a69d2a793ea65 (diff)
downloadqt4-tools-f1344a817fdb3d263bd64f4440fedc73ad94ad31.tar.gz
Don't emit xChanged()/yChanged() twice.
Once from QGraphicsObject (QGraphicsItemPrivate::setPosHelper()) and once from QDeclarativeItem::geometryChanged(). Remove from geometryChanged(). Task-number: QTBUG-14942 Reviewed-by: Michael Brasser
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index b4903aea9d..711bf00643 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -686,6 +686,8 @@ void tst_QDeclarativeItem::propertyChanges()
QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
QSignalSpy wantsFocusSpy(parentItem, SIGNAL(activeFocusChanged(bool)));
QSignalSpy childrenChangedSpy(parentItem, SIGNAL(childrenChanged()));
+ QSignalSpy xSpy(item, SIGNAL(xChanged()));
+ QSignalSpy ySpy(item, SIGNAL(yChanged()));
item->setParentItem(parentItem);
item->setWidth(100.0);
@@ -731,6 +733,14 @@ void tst_QDeclarativeItem::propertyChanges()
QCOMPARE(parentItem->hasFocus(), false);
QCOMPARE(wantsFocusSpy.count(),0);
+ item->setX(10.0);
+ QCOMPARE(item->x(), 10.0);
+ QCOMPARE(xSpy.count(), 1);
+
+ item->setY(10.0);
+ QCOMPARE(item->y(), 10.0);
+ QCOMPARE(ySpy.count(), 1);
+
delete canvas;
}