diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-09-27 18:43:31 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-10-01 07:03:59 +0100 |
commit | e532a1cf37855f79a0a662d9b07786337e5fd220 (patch) | |
tree | 63e1db51740285e44bdc32ec49f7e135b5405f97 /src/input/frontend/qabstractphysicaldevice.cpp | |
parent | ecd455dc00ced212a156f678cd022c10652c8422 (diff) |
Update device nodes to use direct sync
Change-Id: Ic93968816b719ff407db1d1f2f67d906fab3ca0a
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/input/frontend/qabstractphysicaldevice.cpp')
-rw-r--r-- | src/input/frontend/qabstractphysicaldevice.cpp | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/input/frontend/qabstractphysicaldevice.cpp b/src/input/frontend/qabstractphysicaldevice.cpp index 120ec43a2..b925f8ed3 100644 --- a/src/input/frontend/qabstractphysicaldevice.cpp +++ b/src/input/frontend/qabstractphysicaldevice.cpp @@ -168,12 +168,7 @@ void QAbstractPhysicalDevice::addAxisSetting(QAxisSetting *axisSetting) { Q_D(QAbstractPhysicalDevice); if (axisSetting && !d->m_axisSettings.contains(axisSetting)) { - if (d->m_changeArbiter) { - const auto change = Qt3DCore::QPropertyNodeAddedChangePtr::create(id(), axisSetting); - change->setPropertyName("axisSettings"); - d->notifyObservers(change); - } - + d->update(); d->m_axisSettings.push_back(axisSetting); } } @@ -185,12 +180,7 @@ void QAbstractPhysicalDevice::removeAxisSetting(QAxisSetting *axisSetting) { Q_D(QAbstractPhysicalDevice); if (axisSetting && d->m_axisSettings.contains(axisSetting)) { - if (d->m_changeArbiter) { - const auto change = Qt3DCore::QPropertyNodeRemovedChangePtr::create(id(), axisSetting); - change->setPropertyName("axisSettings"); - d->notifyObservers(change); - } - + d->update(); d->m_axisSettings.removeOne(axisSetting); } } @@ -209,11 +199,8 @@ QVector<QAxisSetting *> QAbstractPhysicalDevice::axisSettings() const */ void QAbstractPhysicalDevicePrivate::postAxisEvent(int axis, qreal value) { - Q_Q(QAbstractPhysicalDevice); - Qt3DCore::QPropertyUpdatedChangePtr change(new Qt3DCore::QPropertyUpdatedChange(q->id())); - change->setPropertyName("axisEvent"); - change->setValue(QVariant::fromValue(QPair<int, qreal>(axis, value))); - notifyObservers(change); + m_pendingAxisEvents.push_back({axis, value}); + update(); } /* @@ -221,11 +208,8 @@ void QAbstractPhysicalDevicePrivate::postAxisEvent(int axis, qreal value) */ void QAbstractPhysicalDevicePrivate::postButtonEvent(int button, qreal value) { - Q_Q(QAbstractPhysicalDevice); - Qt3DCore::QPropertyUpdatedChangePtr change(new Qt3DCore::QPropertyUpdatedChange(q->id())); - change->setPropertyName("buttonEvent"); - change->setValue(QVariant::fromValue(QPair<int, qreal>(button, value))); - notifyObservers(change); + m_pendingButtonsEvents.push_back({button, value}); + update(); } /*! |