#include <private/qtextcontrol_p.h>
#include "../shared/util.h"
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <Carbon/Carbon.h>
#endif
QCOMPARE(edit.isCursorVisible(), true);
QCOMPARE(spy.count(), 5);
- QEXPECT_FAIL("", "Most likely a side-effect of QTBUG-21489", Abort);
- view.setWindowState(Qt::WindowNoState);
+ QQuickView alternateView;
+ alternateView.show();
+ alternateView.requestActivateWindow();
+ QTest::qWaitForWindowShown(&alternateView);
+
QCOMPARE(edit.isCursorVisible(), false);
QCOMPARE(spy.count(), 6);
view.requestActivateWindow();
+ QTest::qWaitForWindowShown(&view);
QCOMPARE(edit.isCursorVisible(), true);
QCOMPARE(spy.count(), 7);
-
- // on mac, setActiveWindow(0) on mac does not deactivate the current application
- // (you have to switch to a different app or hide the current app to trigger this)
-#if !defined(Q_WS_MAC)
- // on mac, setActiveWindow(0) on mac does not deactivate the current application
- // (you have to switch to a different app or hide the current app to trigger this)
-// QApplication::setActiveWindow(0);
-// QTRY_COMPARE(QApplication::focusWindow(), static_cast<QWidget *>(0));
-// QCOMPARE(edit.isCursorVisible(), false);
-// QCOMPARE(spy.count(), 8);
-
-// view.requestActivateWindow();
-// QTest::qWaitForWindowShown(&view);
-// QTRY_COMPARE(view.windowState(), Qt::WindowActive);
-// QCOMPARE(edit.isCursorVisible(), true);
-// QCOMPARE(spy.count(), 9);
-#endif
}
void tst_qquicktextedit::delegateLoading_data()
void tst_qquicktextedit::copyAndPaste() {
#ifndef QT_NO_CLIPBOARD
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
{
PasteboardRef pasteboard;
OSStatus status = PasteboardCreate(0, &pasteboard);
ic.sendPreeditText(preeditText, 0);
currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
QCOMPARE(currentRect, previousRect);
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed.
-#endif
QCOMPARE(cursorRectangleSpy.count(), 0);
// Verify that the micro focus rect moves to the left as the cursor position
ic.sendPreeditText(preeditText, i);
currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
QVERIFY(previousRect.left() < currentRect.left());
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
QCOMPARE(ic.updateReceived, true);
-#endif
QVERIFY(cursorRectangleSpy.count() > 0);
cursorRectangleSpy.clear();
previousRect = currentRect;
ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
QCOMPARE(currentRect, previousRect);
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
QCOMPARE(ic.updateReceived, true);
-#endif
QVERIFY(cursorRectangleSpy.count() > 0);
#endif
}