diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-20 15:47:40 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-20 13:00:02 +0000 |
commit | 3ce75f4d72dee45a9d5fb2a01ee2b4c081bf8879 (patch) | |
tree | 5db68e7e9793d7654cfff75574ea2aa4883a91b9 /examples | |
parent | 951a8b4b47cfee4df1d8e9252967c52768d43e05 (diff) |
Fix AutoScroller
Use the timer properly, restarting the timer instead of calling
onTriggered handler directly.
Connect to Qt.inputMethod.animation property, and update auto scroll
when the animation ends.
Simplify signal Connection usage, remove duplicate Connection instances
and just target Qt.inputMethod uncoditionally.
Task-number: QTBUG-66294
Change-Id: Ie82f91cbc8ef84b4a453fa981f2e638bec190073
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/virtualkeyboard/basic/content/AutoScroller.qml | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/virtualkeyboard/basic/content/AutoScroller.qml b/examples/virtualkeyboard/basic/content/AutoScroller.qml index d8d84a50..2ea8efb0 100644 --- a/examples/virtualkeyboard/basic/content/AutoScroller.qml +++ b/examples/virtualkeyboard/basic/content/AutoScroller.qml @@ -52,7 +52,7 @@ Item { } parent_ = parent_.parent } - delayedLoading.triggered() + delayedLoading.restart() } } @@ -96,12 +96,9 @@ Item { } Connections { ignoreUnknownSignals: true - target: inputItem && !Qt.inputMethod.animating ? Qt.inputMethod : null - onKeyboardRectangleChanged: delayedLoading.triggered() - } - Connections { - ignoreUnknownSignals: true - target: inputItem && inputItem.activeFocus ? inputItem : null - onCursorRectangleChanged: delayedLoading.triggered() + target: Qt.inputMethod + onAnimatingChanged: if (inputItem && !Qt.inputMethod.animating) delayedLoading.restart() + onKeyboardRectangleChanged: if (inputItem) delayedLoading.restart() + onCursorRectangleChanged: if (inputItem && inputItem.activeFocus) delayedLoading.restart() } } |