summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-10-08 03:01:11 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-10-08 03:01:11 (GMT)
commit5447a9590dc0efa1a79fde6235fdcf76d3ae81fe (patch)
tree5f1e4e7e383d7b9d7224acefce0d37c4d6be20df /tests/auto
parent10f0cc708b8e7fc2206d1a141dfd4122e7a6f4b0 (diff)
downloadQt-5447a9590dc0efa1a79fde6235fdcf76d3ae81fe.zip
Qt-5447a9590dc0efa1a79fde6235fdcf76d3ae81fe.tar.gz
Qt-5447a9590dc0efa1a79fde6235fdcf76d3ae81fe.tar.bz2
Add test for QTBUG-14279
Task-number: QTBUG-14279
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp5
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
index 2348444..55b0812 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
+++ b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
@@ -4,11 +4,13 @@ Item {
id: root
property int clicked: 0
property int doubleClicked: 0
+ property int released: 0
MouseArea {
width: 200; height: 200
onClicked: { root.clicked++ }
onDoubleClicked: { root.doubleClicked++ }
+ onReleased: { root.released++ }
}
}
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index 5e88450..5a50e0d 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -413,14 +413,19 @@ void tst_QDeclarativeMouseArea::doubleClick()
releaseEvent.setButtons(Qt::LeftButton);
QApplication::sendEvent(scene, &releaseEvent);
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 1);
+
QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick);
dblClickEvent.setScenePos(QPointF(100, 100));
dblClickEvent.setButton(Qt::LeftButton);
dblClickEvent.setButtons(Qt::LeftButton);
QApplication::sendEvent(scene, &dblClickEvent);
+ QApplication::sendEvent(scene, &releaseEvent);
+
QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1);
QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1);
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
}
QTEST_MAIN(tst_QDeclarativeMouseArea)