| 1 | // Copyright (C) 2016 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 "qanalogaxisinput.h" |
| 5 | #include "qanalogaxisinput_p.h" |
| 6 | |
| 7 | #include <Qt3DInput/qabstractphysicaldevice.h> |
| 8 | |
| 9 | QT_BEGIN_NAMESPACE |
| 10 | |
| 11 | namespace Qt3DInput { |
| 12 | |
| 13 | /*! |
| 14 | * \qmltype AnalogAxisInput |
| 15 | * \nativetype Qt3DInput::QAnalogAxisInput |
| 16 | * \inqmlmodule Qt3D.Input |
| 17 | * \brief QML frontend for QAnalogAxisInput C++ class. |
| 18 | * \since 5.7 |
| 19 | * \TODO |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | /*! |
| 24 | * \class Qt3DInput::QAnalogAxisInput |
| 25 | * \inheaderfile Qt3DInput/QAnalogAxisInput |
| 26 | * \inmodule Qt3DInput |
| 27 | * \brief An axis input controlled by an analog input |
| 28 | * \since 5.7 |
| 29 | * The axis value is controlled like a traditional analog input such as a joystick. |
| 30 | * |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | /*! |
| 35 | \qmlproperty int AnalogAxisInput::axis |
| 36 | |
| 37 | Holds the axis for the AnalogAxisInput. |
| 38 | */ |
| 39 | |
| 40 | |
| 41 | /*! |
| 42 | Constructs a new QAnalogAxisInput instance with \a parent. |
| 43 | */ |
| 44 | QAnalogAxisInput::QAnalogAxisInput(Qt3DCore::QNode *parent) |
| 45 | : QAbstractAxisInput(*new QAnalogAxisInputPrivate, parent) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | /*! \internal */ |
| 50 | QAnalogAxisInput::~QAnalogAxisInput() |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | /*! |
| 55 | \property Qt3DInput::QAnalogAxisInput::axis |
| 56 | |
| 57 | Axis for the analog input. |
| 58 | |
| 59 | \sa Qt3DInput::QMouseDevice::Axis |
| 60 | */ |
| 61 | void QAnalogAxisInput::setAxis(int axis) |
| 62 | { |
| 63 | Q_D(QAnalogAxisInput); |
| 64 | if (d->m_axis != axis) { |
| 65 | d->m_axis = axis; |
| 66 | emit axisChanged(axis); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | int QAnalogAxisInput::axis() const |
| 71 | { |
| 72 | Q_D(const QAnalogAxisInput); |
| 73 | return d->m_axis; |
| 74 | } |
| 75 | |
| 76 | } // Qt3DInput |
| 77 | |
| 78 | QT_END_NAMESPACE |
| 79 | |
| 80 | #include "moc_qanalogaxisinput.cpp" |
| 81 | |