QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
QCOMPARE(testObject->mText, QLatin1String("A"));
testObject->reset();
key = QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ShiftModifier, "A", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
QCOMPARE(testObject->mText, QLatin1String("A"));
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_Return));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Return));
QCOMPARE(testObject->mText, QLatin1String("Return"));
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_0, Qt::NoModifier, "0", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_0));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_0));
QCOMPARE(testObject->mText, QLatin1String("0"));
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_9, Qt::NoModifier, "9", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_9));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_9));
QCOMPARE(testObject->mText, QLatin1String("9"));
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_Tab));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Tab));
QCOMPARE(testObject->mText, QLatin1String("Tab"));
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_Backtab));
QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Backtab));
QCOMPARE(testObject->mText, QLatin1String("Backtab"));
canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(false));
key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
QCOMPARE(testObject->mForwardedKey, 0);
QCOMPARE(testObject->mText, QLatin1String("A"));
QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, 0);
QVERIFY(!key.isAccepted());
QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_Return));
QVERIFY(key.isAccepted());
QVERIFY(testItem);
QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
QCOMPARE(testObject->mText, QLatin1String("A"));
QVERIFY(testObject->mModifiers == Qt::NoModifier);
testObject->setProcessLast(true);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, 0);
QVERIFY(key.isAccepted());
testObject->reset();
key = QKeyEvent(QEvent::KeyPress, Qt::Key_B, Qt::NoModifier, "B", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_B));
QCOMPARE(testObject->mText, QLatin1String("B"));
QVERIFY(testObject->mModifiers == Qt::NoModifier);
testObject->reset();
key = QKeyEvent(QEvent::KeyRelease, Qt::Key_B, Qt::NoModifier, "B", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, 0);
QVERIFY(key.isAccepted());
// right
QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item2");
// down
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// left
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item3");
// up
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// tab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item2");
// backtab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
rootItemPrivate->resolveLayoutMirror();
QEvent wa(QEvent::WindowActivate);
- QApplication::sendEvent(canvas, &wa);
+ QGuiApplication::sendEvent(canvas, &wa);
QFocusEvent fe(QEvent::FocusIn);
- QApplication::sendEvent(canvas, &fe);
+ QGuiApplication::sendEvent(canvas, &fe);
QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1");
QVERIFY(item);
// right
QKeyEvent key(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item2");
// left
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// right
QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// tab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item3");
// backtab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// tab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// backtab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
QTRY_VERIFY(QGuiApplication::focusWindow() == canvas);
QEvent wa(QEvent::WindowActivate);
- QApplication::sendEvent(canvas, &wa);
+ QGuiApplication::sendEvent(canvas, &wa);
QFocusEvent fe(QEvent::FocusIn);
- QApplication::sendEvent(canvas, &fe);
+ QGuiApplication::sendEvent(canvas, &fe);
QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1");
QVERIFY(item);
// right
QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item2");
// back to item1
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// down
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item3");
// move to item4
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// left
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item3");
// back to item4
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// up
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item2");
// back to item4
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// tab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item1");
// back to item4
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item4");
// backtab
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
+ QGuiApplication::sendEvent(canvas, &key);
QVERIFY(key.isAccepted());
item = findItem<QQuickItem>(canvas->rootObject(), "item3");
#ifdef OLDWAY
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
#else
QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(100,100));
#endif
#ifdef OLDWAY
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
#else
QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(122,122));
QTest::qWait(50);
QCOMPARE(mouseRegion->mouseY(), rect->y());
QMouseEvent event(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &event);
+ QGuiApplication::sendEvent(canvas, &event);
QCOMPARE(mouseRegion->mouseX(), 100.0);
QCOMPARE(mouseRegion->mouseY(), 100.0);
QCOMPARE(mouseRegion->mouseY(), 0.0);
QMouseEvent event(QEvent::MouseButtonPress, rect->pos().toPoint(), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &event);
+ QGuiApplication::sendEvent(canvas, &event);
QVERIFY(!mouseRegion->property("emitPositionChanged").toBool());
QVERIFY(mouseRegion->property("mouseMatchesPos").toBool());
QVERIFY(canvas->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QVERIFY(!canvas->rootObject()->property("clicked").toBool());
QVERIFY(!canvas->rootObject()->property("held").toBool());
QTest::qWait(1000);
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QVERIFY(!canvas->rootObject()->property("clicked").toBool());
QVERIFY(canvas->rootObject()->property("held").toBool());
QVERIFY(canvas->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QVERIFY(!canvas->rootObject()->property("clicked").toBool());
QTest::qWait(1000);
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QVERIFY(canvas->rootObject()->property("clicked").toBool());
QVERIFY(!canvas->rootObject()->property("mr2_canceled").toBool());
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QVERIFY(canvas->rootObject()->property("mr1_pressed").toBool());
QVERIFY(!canvas->rootObject()->property("mr1_released").toBool());
QTest::qWait(200);
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QVERIFY(canvas->rootObject()->property("mr1_released").toBool());
QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
QVERIFY(!canvas->rootObject()->property("released").toBool());
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QVERIFY(canvas->rootObject()->property("pressed").toBool());
QVERIFY(!canvas->rootObject()->property("canceled").toBool());
QTest::qWait(200);
QEvent windowDeactivateEvent(QEvent::WindowDeactivate);
- QApplication::sendEvent(canvas, &windowDeactivateEvent);
+ QGuiApplication::sendEvent(canvas, &windowDeactivateEvent);
QVERIFY(!canvas->rootObject()->property("pressed").toBool());
QVERIFY(canvas->rootObject()->property("canceled").toBool());
QVERIFY(!canvas->rootObject()->property("released").toBool());
QTest::qWait(200);
//press again
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QVERIFY(canvas->rootObject()->property("pressed").toBool());
QVERIFY(!canvas->rootObject()->property("canceled").toBool());
QVERIFY(!canvas->rootObject()->property("released").toBool());
//release
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QVERIFY(!canvas->rootObject()->property("pressed").toBool());
QVERIFY(!canvas->rootObject()->property("canceled").toBool());
QVERIFY(canvas->rootObject()->property("released").toBool());
QVERIFY(canvas->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QCOMPARE(canvas->rootObject()->property("released").toInt(), 1);
pressEvent = QMouseEvent(QEvent::MouseButtonDblClick, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1);
QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1);
QVERIFY(canvas->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QCOMPARE(canvas->rootObject()->property("pressed").toInt(), 1);
QCOMPARE(canvas->rootObject()->property("released").toInt(), 1);
QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1);
pressEvent = QMouseEvent(QEvent::MouseButtonDblClick, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
- QApplication::sendEvent(canvas, &pressEvent);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QCOMPARE(canvas->rootObject()->property("pressed").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("base"));
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("pressed"));
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
- QApplication::sendEvent(canvas, &releaseEvent);
+ QGuiApplication::sendEvent(canvas, &releaseEvent);
QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("toggled"));
- QApplication::sendEvent(canvas, &pressEvent);
+ QGuiApplication::sendEvent(canvas, &pressEvent);
QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("pressed"));
QCOMPARE(root->property("point2").toBool(), false);
QMouseEvent moveEvent(QEvent::MouseMove, QPoint(32, 32), Qt::NoButton, Qt::NoButton, 0);
- QApplication::sendEvent(canvas, &moveEvent);
+ QGuiApplication::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);
+ QGuiApplication::sendEvent(canvas, &moveEvent2);
QCOMPARE(root->property("point1").toBool(), false);
QCOMPARE(root->property("point2").toBool(), true);