aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp')
-rw-r--r--tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp b/tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp
index 19219bb79e..11d309fd42 100644
--- a/tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp
+++ b/tests/auto/quickcontrols/qquicktextfield/tst_qquicktextfield.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
@@ -84,9 +84,9 @@ void tst_QQuickTextField::touchscreenDoesNotSelect()
if (selectByMouse) {
// press-drag-and-release from x1 to x2
- int x1 = 10;
- int x2 = 70;
- int y = QFontMetrics(textField->font()).height() / 2;
+ const int x1 = textField->leftPadding();
+ const int x2 = textField->width() / 2;
+ const int y = textField->height() / 2;
QTest::touchEvent(&window, touchDevice.data()).press(0, QPoint(x1,y), &window);
QTest::touchEvent(&window, touchDevice.data()).move(0, QPoint(x2,y), &window);
QTest::touchEvent(&window, touchDevice.data()).release(0, QPoint(x2,y), &window);