diff options
Diffstat (limited to 'tests/auto/other/macgui')
-rw-r--r-- | tests/auto/other/macgui/guitest.cpp | 4 | ||||
-rw-r--r-- | tests/auto/other/macgui/macgui.pro | 2 | ||||
-rw-r--r-- | tests/auto/other/macgui/tst_macgui.cpp | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp index 1ddd0ca870..dee7ace1b9 100644 --- a/tests/auto/other/macgui/guitest.cpp +++ b/tests/auto/other/macgui/guitest.cpp @@ -145,7 +145,9 @@ namespace NativeEvents { CGEventType mouseDownType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseDown : (buttons & Qt::RightButton) ? kCGEventRightMouseDown : kCGEventOtherMouseDown; - CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGEventLeftMouseDown; + // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type + // is kCGEventOtherMouseDown, so defaulting to kCGMouseButtonLeft is fine. + CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGMouseButtonLeft; CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseDownType, position, mouseButton); CGEventPost(kCGHIDEventTap, mouseEvent); diff --git a/tests/auto/other/macgui/macgui.pro b/tests/auto/other/macgui/macgui.pro index bf805ccd75..a793a304ca 100644 --- a/tests/auto/other/macgui/macgui.pro +++ b/tests/auto/other/macgui/macgui.pro @@ -6,5 +6,7 @@ HEADERS += guitest.h QT = core-private widgets-private testlib +osx: LIBS += -framework ApplicationServices + requires(mac) DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index 56035f4be4..ba6ac536f2 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -146,7 +146,7 @@ void tst_MacGui::splashScreenModality() connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot())); const int timeout = 4; QTestEventLoop::instance().enterLoop(timeout); - QVERIFY(QTestEventLoop::instance().timeout() == false); + QVERIFY(!QTestEventLoop::instance().timeout()); } class PrimaryWindowDialog : public QDialog @@ -231,7 +231,7 @@ void tst_MacGui::spinBoxArrowButtons() const QRect lessRect = lessInterface->rect(); const QRect lessLocalRect(colorWidget.mapFromGlobal(lessRect.topLeft()), colorWidget.mapFromGlobal(lessRect.bottomRight())); const QRect compareRect = lessLocalRect.adjusted(5, 3, -5, -7); - QVERIFY(noFocus.copy(compareRect) == focus.copy(compareRect)); + QCOMPARE(noFocus.copy(compareRect), focus.copy(compareRect)); } QTEST_MAIN(tst_MacGui) |