diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-01-18 10:11:57 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-01-19 15:21:04 +0000 |
commit | 034ac26201c87179a9bba25571f926a212542cd9 (patch) | |
tree | 9ec401a627f2377970d65a0a3bd1eca8058b255d | |
parent | 0e9917152e411147cb42b12229dd13320e210de8 (diff) |
QAxisActionHandler: properly set parent on QLogicalDevice
Otherwise the backend node for the logical device may not be created
Change-Id: I90e8185b4e1f1cf4333d7f8b06e654e1e2b6de57
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/input/backend/updatehandlerjob.cpp | 6 | ||||
-rw-r--r-- | src/input/frontend/qaxisactionhandler.cpp | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/input/backend/updatehandlerjob.cpp b/src/input/backend/updatehandlerjob.cpp index 3f9dec326..08b2633cb 100644 --- a/src/input/backend/updatehandlerjob.cpp +++ b/src/input/backend/updatehandlerjob.cpp @@ -86,10 +86,8 @@ void UpdateHandlerJob::run() // If so -> add to notification payload LogicalDevice *logicalDevice = m_handler->logicalDeviceManager()->data(m_logicalDeviceHandle); - if (logicalDevice) { - updateActions(logicalDevice); - updateAxes(logicalDevice); - } + updateActions(logicalDevice); + updateAxes(logicalDevice); } void UpdateHandlerJob::updateAxes(LogicalDevice *device) diff --git a/src/input/frontend/qaxisactionhandler.cpp b/src/input/frontend/qaxisactionhandler.cpp index d69400e5b..d885c50c3 100644 --- a/src/input/frontend/qaxisactionhandler.cpp +++ b/src/input/frontend/qaxisactionhandler.cpp @@ -79,6 +79,11 @@ void QAxisActionHandler::setLogicalDevice(Qt3DInput::QLogicalDevice *logicalDevi if (d->m_logicalDevice == logicalDevice) return; + // Need to set the parent of the logical device if it has none + // so as to trigger the backend node created with a NodeCreated notification + if (logicalDevice && !logicalDevice->parent()) + logicalDevice->setParent(this); + d->m_logicalDevice = logicalDevice; emit logicalDeviceChanged(logicalDevice); } |