aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp')
-rw-r--r--tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
index 8e711e6ceb..e9788cd147 100644
--- a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
+++ b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
@@ -75,6 +75,7 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
void hoverPosition();
+ void hoverPropagation();
private:
QSGView *createView();
@@ -741,6 +742,31 @@ void tst_QSGMouseArea::hoverPosition()
delete canvas;
}
+void tst_QSGMouseArea::hoverPropagation()
+{
+ //QTBUG-18175, to behave like GV did.
+ QSGView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/hoverPropagation.qml"));
+
+ QSGItem *root = canvas->rootObject();
+ QVERIFY(root != 0);
+
+ QCOMPARE(root->property("point1").toBool(), false);
+ QCOMPARE(root->property("point2").toBool(), false);
+
+ QMouseEvent moveEvent(QEvent::MouseMove, QPoint(32, 32), Qt::NoButton, Qt::NoButton, 0);
+ QApplication::sendEvent(canvas, &moveEvent);
+ QCOMPARE(root->property("point1").toBool(), true);
+ QCOMPARE(root->property("point2").toBool(), false);
+
+ QMouseEvent moveEvent2(QEvent::MouseMove, QPoint(232, 32), Qt::NoButton, Qt::NoButton, 0);
+ QApplication::sendEvent(canvas, &moveEvent2);
+ QCOMPARE(root->property("point1").toBool(), false);
+ QCOMPARE(root->property("point2").toBool(), true);
+
+ delete canvas;
+}
+
QTEST_MAIN(tst_QSGMouseArea)
#include "tst_qsgmousearea.moc"