summaryrefslogtreecommitdiffstats
path: root/src/input/frontend/qabstractphysicaldevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/frontend/qabstractphysicaldevice.cpp')
-rw-r--r--src/input/frontend/qabstractphysicaldevice.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/input/frontend/qabstractphysicaldevice.cpp b/src/input/frontend/qabstractphysicaldevice.cpp
index a47b915fd..61236e215 100644
--- a/src/input/frontend/qabstractphysicaldevice.cpp
+++ b/src/input/frontend/qabstractphysicaldevice.cpp
@@ -35,14 +35,25 @@
****************************************************************************/
#include "qabstractphysicaldevice.h"
+#include "qabstractphysicaldevice_p.h"
#include <Qt3DCore/private/qnode_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DInput {
+QAbstractPhysicalDevicePrivate::QAbstractPhysicalDevicePrivate()
+ : m_axisSettings()
+{
+}
+
QAbstractPhysicalDevice::QAbstractPhysicalDevice(Qt3DCore::QNode *parent)
- : Qt3DCore::QNode(parent)
+ : Qt3DCore::QNode(*new QAbstractPhysicalDevicePrivate, parent)
+{
+}
+
+QAbstractPhysicalDevice::QAbstractPhysicalDevice(QAbstractPhysicalDevicePrivate &dd, Qt3DCore::QNode *parent)
+ : Qt3DCore::QNode(dd, parent)
{
}
@@ -51,6 +62,33 @@ QAbstractPhysicalDevice::~QAbstractPhysicalDevice()
Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DInput::QAbstractPhysicalDevice subclass didn't call QNode::cleanup in its destructor");
}
+void QAbstractPhysicalDevice::addAxisSetting(QAxisSetting *axisSetting)
+{
+ Q_D(QAbstractPhysicalDevice);
+ if (!d->m_axisSettings.contains(axisSetting))
+ d->m_axisSettings.push_back(axisSetting);
+}
+
+void QAbstractPhysicalDevice::removeAxisSetting(QAxisSetting *axisSetting)
+{
+ Q_D(QAbstractPhysicalDevice);
+ if (d->m_axisSettings.contains(axisSetting))
+ d->m_axisSettings.removeOne(axisSetting);
+}
+
+QVector<QAxisSetting *> QAbstractPhysicalDevice::axisSettings() const
+{
+ Q_D(const QAbstractPhysicalDevice);
+ return d->m_axisSettings;
+}
+
+void QAbstractPhysicalDevice::copy(const QNode *ref)
+{
+ QNode::copy(ref);
+ const QAbstractPhysicalDevice *physicalDevice = static_cast<const QAbstractPhysicalDevice *>(ref);
+ d_func()->m_axisSettings = physicalDevice->axisSettings();
+}
+
}
QT_END_NAMESPACE