diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-09-27 15:09:00 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-09-30 07:56:13 +0100 |
commit | c40cccb0b4485045db61c2d4e825e33a68c58861 (patch) | |
tree | 9cbdd1615a505e7e936cb1915b6a0bac7e8208d1 /src/input/frontend/qaxis.cpp | |
parent | bd3aa578b8d822840fc3d4a6ef819b29b2c26034 (diff) |
Reset input axis changes when enabling camera controller
When input axis are enabled or disable, we now reset the value
to 0. And enabling or disabling the camera controller, we now
do the same for the axis. This prevents residual movement when
re-enabling the controller due to the asynchronous updates.
Task-number: QTBUG-77996
Change-Id: I5ac016d5b708e1f8d8eaa996bbd28c00c0f05e79
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/input/frontend/qaxis.cpp')
-rw-r--r-- | src/input/frontend/qaxis.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input/frontend/qaxis.cpp b/src/input/frontend/qaxis.cpp index 01e28e9cf..1830c8005 100644 --- a/src/input/frontend/qaxis.cpp +++ b/src/input/frontend/qaxis.cpp @@ -83,6 +83,10 @@ namespace Qt3DInput { QAxis::QAxis(Qt3DCore::QNode *parent) : Qt3DCore::QNode(*new QAxisPrivate(), parent) { + Q_D(QAxis); + connect(this, &QAxis::enabledChanged, [d]() { + d->setValue(0.); + }); } /*! \internal */ |