From ca5d6cccde1f977eedb46f3320fe8384ea41758e Mon Sep 17 00:00:00 2001 From: Wang Chuan Date: Mon, 5 Apr 2021 11:41:48 +0800 Subject: QQuickTextInput: update cursor rectangle after padding changed The position of cursor delegate needs to be updated when we change padding, otherwise it will be in a wrong position. Fixes: QTBUG-91867 Change-Id: I89ca84fe893ebf517ab67890196eede14a4055d7 Reviewed-by: Shawn Rutledge (cherry picked from commit d98694c4023881673259ba040c10df7e71ec3d37) --- .../data/checkCursorDelegateWhenPaddingChanged.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/auto/quick/qquicktextinput/data/checkCursorDelegateWhenPaddingChanged.qml (limited to 'tests/auto/quick/qquicktextinput/data') diff --git a/tests/auto/quick/qquicktextinput/data/checkCursorDelegateWhenPaddingChanged.qml b/tests/auto/quick/qquicktextinput/data/checkCursorDelegateWhenPaddingChanged.qml new file mode 100644 index 0000000000..e6f07b4687 --- /dev/null +++ b/tests/auto/quick/qquicktextinput/data/checkCursorDelegateWhenPaddingChanged.qml @@ -0,0 +1,16 @@ +import QtQuick 2.12 + +Rectangle { + width: 200 + height: 200 + TextInput { + objectName: "textInput" + leftPadding: 10 + focus: true + cursorDelegate: Rectangle { + objectName: "cursorDelegate" + width: 5 + color: "red" + } + } +} -- cgit v1.2.3