1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "qabstractaxisinput.h" |
5 | #include "qabstractaxisinput_p.h" |
6 | |
7 | #include <Qt3DInput/qabstractphysicaldevice.h> |
8 | |
9 | #include <Qt3DInput/private/abstractaxisinput_p.h> |
10 | #include <Qt3DInput/private/inputhandler_p.h> |
11 | #include <Qt3DInput/private/qinputdeviceintegration_p.h> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | namespace Qt3DInput { |
16 | |
17 | namespace Input { |
18 | |
19 | AbstractAxisInput::AbstractAxisInput() |
20 | : BackendNode() |
21 | { |
22 | } |
23 | |
24 | void AbstractAxisInput::cleanup() |
25 | { |
26 | QBackendNode::setEnabled(false); |
27 | m_sourceDevice = Qt3DCore::QNodeId(); |
28 | } |
29 | |
30 | void AbstractAxisInput::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) |
31 | { |
32 | BackendNode::syncFromFrontEnd(frontEnd, firstTime); |
33 | const QAbstractAxisInput *node = qobject_cast<const QAbstractAxisInput *>(object: frontEnd); |
34 | if (!node) |
35 | return; |
36 | |
37 | m_sourceDevice = Qt3DCore::qIdForNode(node: node->sourceDevice()); |
38 | } |
39 | |
40 | } // Input |
41 | |
42 | } // Qt3DInput |
43 | |
44 | QT_END_NAMESPACE |
45 |