diff options
author | Colin Ogilvie <colin.ogilvie@kdab.com> | 2016-01-28 11:23:42 +0000 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-06-03 06:27:50 +0000 |
commit | bbb264ad66ca590513dc297821aed26d39d32008 (patch) | |
tree | b81e2702f6bec758798f8f9b0755cca58a18c1b8 /src/input | |
parent | 8487e1478c929bed1e60847feaf71d04db67cae8 (diff) |
Transfer previously written doc for input module
Task-number: QTBUG-46037
Change-Id: I43a3b84cb55e67b30b1b145aabbffa23f9cf9017
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/frontend/qactioninput.cpp | 42 | ||||
-rw-r--r-- | src/input/frontend/qaxis.cpp | 37 | ||||
-rw-r--r-- | src/input/frontend/qaxissetting.cpp | 130 | ||||
-rw-r--r-- | src/input/frontend/qinputaspect.cpp | 17 | ||||
-rw-r--r-- | src/input/frontend/qinputdeviceintegration.cpp | 42 | ||||
-rw-r--r-- | src/input/frontend/qinputsequence.cpp | 4 | ||||
-rw-r--r-- | src/input/frontend/qinputsettings.cpp | 36 | ||||
-rw-r--r-- | src/input/frontend/qkeyevent.cpp | 2 |
8 files changed, 262 insertions, 48 deletions
diff --git a/src/input/frontend/qactioninput.cpp b/src/input/frontend/qactioninput.cpp index e15f7517b..421836719 100644 --- a/src/input/frontend/qactioninput.cpp +++ b/src/input/frontend/qactioninput.cpp @@ -129,6 +129,25 @@ QVector<int> QActionInput::buttons() const The current source device of the QActionInput. */ +/*! + \fn QActionInput::sourceDeviceChanged() + + This signal is emitted when the source device ascociated with the action input is changed. +*/ + +/*! + \qmlproperty QAbstractPhysicalDevice Qt3D.Input::ActionInput::sourceDevice + + The current source device of the ActionInput +*/ + +/*! + \qmlsignal Qt3D.Input::ActionInput::sourceDeviceChanged() + + This signal is emitted when the source device ascociated with the action input is changed. + + The corresponding handler is \c onSourceDeviceChanged +*/ void QActionInput::setSourceDevice(QAbstractPhysicalDevice *sourceDevice) { Q_D(QActionInput); @@ -158,6 +177,29 @@ QAbstractPhysicalDevice *QActionInput::sourceDevice() const return d->m_sourceDevice; } +/*! + \fn QAbstractPhysicalDevice::buttonsChanged() + + This signal is emitted when the buttons ascociated with the action input is changed. +*/ + +/*! + \qmlproperty QVariantList Qt3D.Input::ActionInput::buttons + + The Buttons that can trigger this Action +*/ + +/*! + \qmlsignal Qt3D.Input::ActionInput::buttonsChanged() + + This signal is emitted when the buttons ascociated with the action input is changed. + + The corresponding handler is \c onbuttonsChanged +*/ + +/*! + Set the buttons to trigger the QActionInput instance. + */ void QActionInput::setButtons(const QVector<int> &buttons) { Q_D(QActionInput); diff --git a/src/input/frontend/qaxis.cpp b/src/input/frontend/qaxis.cpp index 212405351..ab79432b1 100644 --- a/src/input/frontend/qaxis.cpp +++ b/src/input/frontend/qaxis.cpp @@ -49,22 +49,23 @@ QT_BEGIN_NAMESPACE namespace Qt3DInput { /*! - * \qmltype Axis - * \inqmlmodule Qt3D.Input - * \brief QML frontend for QAxis C++ class. - * \since 5.5 - * \TODO - * - */ + Constructs a new QAxis instance with \a parent. + \class Qt3DInput::QAxis + \inmodule Qt3DInput + \inherits Qt3DCore::QNode + \brief QAxis stores QAbstractAxisInputs used to trigger an input event. + \since 5.7 +*/ /*! - * \class Qt3DInput::QAxis - * \inmodule Qt3DInput - * \brief A QAxis class. - * \since 5.5 - * \TODO - * - */ + \qmltype Axis + \inqmlmodule Qt3D.Input + \instantiates Qt3DInput::QAxis + \brief QML frontend for the Qt3DInput::QAxis C++ class. + + Links a set of AbstractAxisInputs that trigger the same event. + \since 5.7 +*/ /*! \qmlproperty int QAxis::value @@ -80,7 +81,7 @@ namespace Qt3DInput { */ /*! - Constructs a new QAxis instance with \a parent. + Constructs a new QAxis instance with parent \a parent. */ QAxis::QAxis(Qt3DCore::QNode *parent) : Qt3DCore::QNode(*new QAxisPrivate(), parent) @@ -93,6 +94,12 @@ QAxis::~QAxis() } /*! + \qmlproperty QQmlListProperty<Qt3DInput::QAbstractAxisInput> Qt3D.Input::Axis::inputs + + the list of QAbstractAxisInput that can trigger this Axis. +*/ + +/*! QAxis::addInput Adds an \a input for the axis. diff --git a/src/input/frontend/qaxissetting.cpp b/src/input/frontend/qaxissetting.cpp index 37013f74c..bbdcacc1d 100644 --- a/src/input/frontend/qaxissetting.cpp +++ b/src/input/frontend/qaxissetting.cpp @@ -44,37 +44,38 @@ QT_BEGIN_NAMESPACE namespace Qt3DInput { - /*! - * \qmltype AxisSetting - * \instantiates Qt3DInput::QAxisSetting - * \inqmlmodule Qt3D.Input - * \brief QML frontend for QAxisSetting C++ class. - * \since 5.5 - * \TODO - * - */ + \class Qt3DInput::QAxisSetting + \inmodule Qt3DInput + \inherits Qt3DCore::QNode + \brief QAxisSetting stores settings for the specified list of Axis. -/*! - * \class Qt3DInput::QAxisSetting - * \inmodule Qt3DInput - * \brief A QAxisSetting class. - * \since 5.5 - * \TODO - * - */ + Stores the dead zone associated with this axis and defines if smoothing is enabled + \since 5.5 +*/ /*! - \qmlproperty real AxisSetting::deadZoneRadius + + \qmltype AxisSetting + \inqmlmodule Qt3D.Input + \instantiates Qt3DInput::QAxisSetting + \brief QML frontend for the Qt3DInput::QAxisSetting C++ class. + + Stores settings for the specified list of Axis + \since 5.5 */ /*! - \qmlproperty list<int> AxisSetting::axes -*/ + \qmlproperty real AxisSetting::deadZoneRadius + */ /*! - \qmlproperty bool AxisSetting::smooth -*/ + \qmlproperty list<int> AxisSetting::axes + */ + +/*! + \qmlproperty bool AxisSetting::smooth + */ /*! Constructs a new QAxisSetting instance with \a parent. @@ -92,6 +93,11 @@ QAxisSetting::~QAxisSetting() /*! \property QAxisSetting::axes */ + +/*! + * \brief QAxisSetting::axes + * \return the current list of Axis these settings apply to. + */ QVector<int> QAxisSetting::axes() const { Q_D(const QAxisSetting); @@ -101,6 +107,11 @@ QVector<int> QAxisSetting::axes() const /*! \property QAxisSetting::deadZoneRadius */ + +/*! + * \brief QAxisSetting::deadZoneRadius + * \return the set dead zone radius. + */ float QAxisSetting::deadZoneRadius() const { Q_D(const QAxisSetting); @@ -110,12 +121,41 @@ float QAxisSetting::deadZoneRadius() const /*! \property QAxisSetting::smooth */ + +/*! + * \brief QAxisSetting::isSmoothEnabled + * \return if smoothing is enabled. + */ bool QAxisSetting::isSmoothEnabled() const { Q_D(const QAxisSetting); return d->m_smooth; } + +/*! + \fn QAxisSetting::deadZoneRadiusChanged() + + This signal is emitted when the Dead Zone radius associated with the axis setting is changed. +*/ + +/*! + \qmlproperty float Qt3D.Input::AxisSetting::deadZoneRadius + + The current deadZone radius of the AxisSetting +*/ + +/*! + \qmlsignal Qt3D.Input::AxisSetting::deadZoneRadiusChanged() + + This signal is emitted when the dead zone associated with the axis setting is changed. + + The corresponding handler is \c onDeadZoneRadiusChanged +*/ + +/*! + Set the current dead zone radius of the QAxisSetting instance. + */ void QAxisSetting::setDeadZoneRadius(float deadZoneRadius) { Q_D(QAxisSetting); @@ -126,6 +166,29 @@ void QAxisSetting::setDeadZoneRadius(float deadZoneRadius) emit deadZoneRadiusChanged(deadZoneRadius); } +/*! + \fn QAxisSetting::axisChanged() + + This signal is emitted when the axis ascociated with the axis setting is changed. +*/ + +/*! + \qmlproperty QVariantList Qt3D.Input::AxisSetting::axis + + The current axis of the AxisSetting +*/ + +/*! + \qmlsignal Qt3D.Input::AxisSetting::axisChanged() + + This signal is emitted when the axis ascociated with the axis setting is changed. + + The corresponding handler is \c onAxisChanged +*/ + +/*! + Set the current axis of the QAxisSetting instance. + */ void QAxisSetting::setAxes(const QVector<int> &axes) { Q_D(QAxisSetting); @@ -136,6 +199,29 @@ void QAxisSetting::setAxes(const QVector<int> &axes) emit axesChanged(axes); } +/*! + \fn QAxisSetting::smoothChanged() + + This signal is emitted when the smoothing state is changed. +*/ + +/*! + \qmlproperty bool Qt3D.Input::AxisSetting::smooth + + The current state of smoothing +*/ + +/*! + \qmlsignal Qt3D.Input::AxisSetting::smoothChanged() + + This signal is emitted when the when the smoothing state is changed. + + The corresponding handler is \c onSmoothChanged +*/ + +/*! + Set the current state of the QAxisSettings smoothing. + */ void QAxisSetting::setSmoothEnabled(bool enabled) { Q_D(QAxisSetting); diff --git a/src/input/frontend/qinputaspect.cpp b/src/input/frontend/qinputaspect.cpp index fbd7674d8..0b7df1299 100644 --- a/src/input/frontend/qinputaspect.cpp +++ b/src/input/frontend/qinputaspect.cpp @@ -108,6 +108,10 @@ QInputAspectPrivate::QInputAspectPrivate() \inmodule Qt3DInput \brief A QInputAspect class. \since 5.5 + \brief Handles mapping between front and backend nodes + + QInputAspect is responsible for creating physical devices. + It is also the object responsible establishing the jobs to run at a particular time from the current input setup. */ /*! @@ -156,6 +160,9 @@ QInputAspect::~QInputAspect() { } +/*! + Create each of the detected input device integrations through the Integration Factory + */ void QInputAspectPrivate::loadInputDevicePlugins() { const QStringList keys = QInputDeviceIntegrationFactory::keys(); @@ -172,12 +179,12 @@ void QInputAspectPrivate::loadInputDevicePlugins() } } - /*! - Creates a physical device with \a name. - - \note The caller is responsible for ownership. - */ + Create a physical device identified by \a name using the input device integrations present + returns a Q_NULLPTR if it is not found. + \note caller is responsible for ownership +*/ +// Note: caller is responsible for ownership QAbstractPhysicalDevice *QInputAspect::createPhysicalDevice(const QString &name) { Q_D(QInputAspect); diff --git a/src/input/frontend/qinputdeviceintegration.cpp b/src/input/frontend/qinputdeviceintegration.cpp index db48fd059..01f6b931e 100644 --- a/src/input/frontend/qinputdeviceintegration.cpp +++ b/src/input/frontend/qinputdeviceintegration.cpp @@ -52,22 +52,40 @@ QInputDeviceIntegrationPrivate::QInputDeviceIntegrationPrivate() { } +/*! + \class Qt3DInput::QInputDeviceIntegration + \inmodule Qt3DInput + \since 5.5 + \brief Abstract base class used to define new input methods such as game controllers + +*/ + +/*! + Create a new QInputDeviceIntegration with parent /a parent + */ QInputDeviceIntegration::QInputDeviceIntegration(QObject *parent) : QObject(*new QInputDeviceIntegrationPrivate, parent) { } +/*! \internal */ QInputDeviceIntegration::QInputDeviceIntegration(QInputDeviceIntegrationPrivate &dd, QObject *parent) : QObject(dd, parent) { } +/*! + Register a corresponding backend class for this front end implementation + */ void QInputDeviceIntegration::registerBackendType(const QMetaObject &metaObject, const Qt3DCore::QBackendNodeMapperPtr &functor) { Q_D(QInputDeviceIntegration); d->m_aspect->registerBackendType(metaObject, functor); } +/*! + Called by the InputAspect object after the Integration has been created + */ void QInputDeviceIntegration::initialize(QInputAspect *aspect) { Q_D(QInputDeviceIntegration); @@ -75,6 +93,10 @@ void QInputDeviceIntegration::initialize(QInputAspect *aspect) onInitialize(); } +/*! + * \brief QInputDeviceIntegration::inputAspect + * \return the Input Aspect associated with the InputDeviceIntegration + */ QInputAspect *QInputDeviceIntegration::inputAspect() const { Q_D(const QInputDeviceIntegration); @@ -83,4 +105,24 @@ QInputAspect *QInputDeviceIntegration::inputAspect() const } // namespace Qt3DInput +/*! + \fn QInputDeviceIntegration::createPhysicalDevice() + + Create the Physical device identified by \a name. + + If not recognized return Q_NULLPTR +*/ + +/*! + \fn QInputDeviceIntegration::physicalDevices() + + \return the list of node ids for physical devices associated with this QInputDeviceIntegration. +*/ + +/*! + \fn QInputDeviceIntegration::physicalDevice(Qt3DCore::QNodeId id) + + \return the QAbstractPhysicalDevice identified by the given id if it is related to this QInputDeviceIntegration. +*/ + QT_END_NAMESPACE diff --git a/src/input/frontend/qinputsequence.cpp b/src/input/frontend/qinputsequence.cpp index 673b93a08..99eff289b 100644 --- a/src/input/frontend/qinputsequence.cpp +++ b/src/input/frontend/qinputsequence.cpp @@ -124,7 +124,7 @@ QInputSequence::~QInputSequence() This signal is emitted when the timeout of the input sequence is changed. - The corresponding handeler is \c onTimeoutChanged + The corresponding handler is \c onTimeoutChanged */ /*! @@ -148,7 +148,7 @@ int QInputSequence::timeout() const This signal is emitted when the buttonInterval of the input sequence is changed. - The corresponding handeler is \c onButtonIntervalChanged + The corresponding handler is \c onButtonIntervalChanged */ /*! diff --git a/src/input/frontend/qinputsettings.cpp b/src/input/frontend/qinputsettings.cpp index fd2261e3d..4034dec38 100644 --- a/src/input/frontend/qinputsettings.cpp +++ b/src/input/frontend/qinputsettings.cpp @@ -48,10 +48,10 @@ namespace Qt3DInput { /*! \class Qt3DInput::QInputSettings \inmodule Qt3DInput - \inherits Qt3DCore::QComponent - \brief A QInputSettings class. + \inherits Qt3DCore::QComponant + \brief QInputSettings stores settings for the specified eventSource. + \since 5.7 - \TODO */ /*! @@ -60,8 +60,9 @@ namespace Qt3DInput { \inherits Component3D \instantiates Qt3DInput::QInputSettings \brief QML frontend for the Qt3DInput::QInputSettings C++ class. + + Stores settings the specified eventSource \since 5.7 - \TODO */ /*! @@ -92,12 +93,39 @@ QInputSettings::~QInputSettings() Holds the source for the QInputSettings. */ +/*! + \fn QInputSettings::eventSourceChanged() + + This signal is emitted when the even source ascociated with the input setting is changed. +*/ + +/*! + \qmlproperty QObject Qt3D.Input::InputSettings::eventSource + + The current event source of the InputSettings object +*/ + +/*! + \qmlsignal Qt3D.Input::InputSettings::eventSourceChanged() + + This signal is emitted when the even source associated with the input setting is changed. + + The corresponding handler is \c onEventSourceChanged +*/ + +/*! + * \brief QInputSettings::eventSource + * \return the current event source of the QInputSettings instance. + */ QObject *QInputSettings::eventSource() const { Q_D(const QInputSettings); return d->m_eventSource; } +/*! + Set the current event source of the QInputSettings instance. + */ void QInputSettings::setEventSource(QObject *eventSource) { Q_D(QInputSettings); diff --git a/src/input/frontend/qkeyevent.cpp b/src/input/frontend/qkeyevent.cpp index ae022af93..49da8b92b 100644 --- a/src/input/frontend/qkeyevent.cpp +++ b/src/input/frontend/qkeyevent.cpp @@ -50,6 +50,7 @@ namespace Qt3DInput { \inmodule Qt3DInput \brief QKeyEvent event type send by KeyBoardHandler. \since 5.5 + \brief Contains parameters that describe a key event */ /*! @@ -58,6 +59,7 @@ namespace Qt3DInput { \instantiates Qt3DInput::QKeyEvent \brief QML frontend for QKeyEvent C++ class. \since 5.5 + \brief Contains parameters that describe a key event The KeyEvent QML type cannot be directly created. Objects of this type are used as signal parameters in KeyboardHandler. |