diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2021-09-03 08:46:40 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-03 17:47:23 +0000 |
commit | 37876cfa90f50905a4e2e2c84d241a67fde40892 (patch) | |
tree | 1b287942069d4d623a27f11009bc3fed9e97ba9e /tests | |
parent | 1faf19bc486b89cd02e47f6b0b3f944400464ef9 (diff) |
Fix wrong assumption about TextField in tst_QQuickPopup::cursorShape()
The test assumed that an empty TextField was wider than 20 pixels.
This is not the case today on macOS native style.
TextField should probably also be made wider on macOS style, but
tst_QQuickPopup::cursorShape() should be more robust in order to
handle this. Afterall, it is not testing TextField, but simply using
it in order to test if the cursor shape changes if the hover is moved
away from the popup.
Task-number: QTBUG-95679
Change-Id: I5130f161a5e92b032d228ffb515816c4043105af
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 9867bc18e1716fa5cf7b4c02830d92513d8fba52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp index 32f5999ed4..51a14a948f 100644 --- a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp +++ b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp @@ -986,13 +986,13 @@ void tst_QQuickPopup::cursorShape() QVERIFY(textField); // Move the mouse over the text field. - const QPoint textFieldPos(popup->x() - 10, textField->height() / 2); + const QPoint textFieldPos(popup->x() - 1, textField->height() / 2); QVERIFY(textField->contains(textField->mapFromScene(textFieldPos))); QTest::mouseMove(window, textFieldPos); QCOMPARE(window->cursor().shape(), textField->cursor().shape()); // Move the mouse over the popup where it overlaps with the text field. - const QPoint textFieldOverlapPos(popup->x() + 10, textField->height() / 2); + const QPoint textFieldOverlapPos(popup->x() + 1, textField->height() / 2); QTest::mouseMove(window, textFieldOverlapPos); QCOMPARE(window->cursor().shape(), popup->popupItem()->cursor().shape()); |