diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2017-01-30 15:42:23 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-31 11:49:15 +0000 |
commit | ea7d5913675ec03977b410d57a579a58229ea6cd (patch) | |
tree | b1e68c14b5bf72eb97f4fc3f9232366f4aafad66 | |
parent | 67f5440de8e53a2596b0fe0d291d7bb3217ea190 (diff) |
Doc: added basic doc for QGamepadManager
Change-Id: I9692182d60d670742895f1dfce9b0e8159548f11
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r-- | src/gamepad/qgamepad.cpp | 24 | ||||
-rw-r--r-- | src/gamepad/qgamepadkeynavigation.cpp | 13 | ||||
-rw-r--r-- | src/gamepad/qgamepadmanager.cpp | 16 |
3 files changed, 41 insertions, 12 deletions
diff --git a/src/gamepad/qgamepad.cpp b/src/gamepad/qgamepad.cpp index 9a759cb..9590c6e 100644 --- a/src/gamepad/qgamepad.cpp +++ b/src/gamepad/qgamepad.cpp @@ -48,9 +48,7 @@ QT_BEGIN_NAMESPACE */ /*! - * \brief Constructs a QGamepad for \a deviceId. - * \param deviceId is the id of the gamepad you wish to see the state of - * \param parent + * Constructs a QGamepad with the given \a deviceId and \a parent. */ QGamepad::QGamepad(int deviceId, QObject *parent) : QObject(parent) @@ -99,10 +97,10 @@ QGamepad::~QGamepad() /*! * \property QGamepad::deviceId * - * This property holds the deviceId of the gamepad device. It is possible for there to be - * multiple gamepad devices connected at any given time, so setting this property defines - * which gamepad to use. + * This property holds the deviceId of the gamepad device. Multiple gamepad devices can be + * connected at any given time, so setting this property defines which gamepad to use. * + * \sa QGamepadManager::connectedGamepads() */ int QGamepad::deviceId() const { @@ -133,7 +131,7 @@ QString QGamepad::name() const * \property QGamepad::axisLeftX * * This property holds the value of the left thumbstick's X axis. - * The range of axis values are from -1.0 to 1.0 + * The range of axis values are from -1.0 to 1.0. */ double QGamepad::axisLeftX() const { @@ -144,7 +142,7 @@ double QGamepad::axisLeftX() const * \property QGamepad::axisLeftY * * This property holds the value of the left thumbstick's Y axis. - * The range of axis values are from -1.0 to 1.0 + * The range of axis values are from -1.0 to 1.0. */ double QGamepad::axisLeftY() const { @@ -155,7 +153,7 @@ double QGamepad::axisLeftY() const * \property QGamepad::axisRightX * * This property holds the value of the right thumbstick's X axis. - * The range of axis values are from -1.0 to 1.0 + * The range of axis values are from -1.0 to 1.0. */ double QGamepad::axisRightX() const { @@ -166,7 +164,7 @@ double QGamepad::axisRightX() const * \property QGamepad::axisRightY * * This property holds the value of the right thumbstick's Y axis. - * The range of axis values are from -1.0 to 1.0 + * The range of axis values are from -1.0 to 1.0. */ double QGamepad::axisRightY() const { @@ -189,6 +187,8 @@ bool QGamepad::buttonA() const * * This property holds the state of the B button. True when pressed, false when not * pressed. + * + * \sa QGamepadManager::connectedGamepads() */ bool QGamepad::buttonB() const { @@ -267,7 +267,7 @@ double QGamepad::buttonR2() const * \property QGamepad::buttonSelect * * This property holds the state of the Select button. True when pressed, false when not - * pressed. This button can sometimes be labled as the Back button on some gamepads. + * pressed. This button can sometimes be labeled as the Back button on some gamepads. */ bool QGamepad::buttonSelect() const { @@ -278,7 +278,7 @@ bool QGamepad::buttonSelect() const * \property QGamepad::buttonStart * * This property holds the state of the Start button. True when pressed, false when not - * pressed. This button can sometimes be labled as the Forward button on some gamepads. + * pressed. This button can sometimes be labeled as the Forward button on some gamepads. */ bool QGamepad::buttonStart() const { diff --git a/src/gamepad/qgamepadkeynavigation.cpp b/src/gamepad/qgamepadkeynavigation.cpp index d88363a..39f663c 100644 --- a/src/gamepad/qgamepadkeynavigation.cpp +++ b/src/gamepad/qgamepadkeynavigation.cpp @@ -42,6 +42,19 @@ QT_BEGIN_NAMESPACE +/*! + \class QGamepadKeyNavigation + \inmodule QtGamepad + \brief Provides support for keyboard events triggered by gamepads. + + QGamepadKeyNavigation provides support for keyboard events triggered by + gamepads. + */ + +/*! + * Constructs a QGamepadNavigation object with the given \a parent. + */ + QGamepadKeyNavigation::QGamepadKeyNavigation(QObject *parent) : QObject(parent) , m_active(true) diff --git a/src/gamepad/qgamepadmanager.cpp b/src/gamepad/qgamepadmanager.cpp index 2c737f6..58422c5 100644 --- a/src/gamepad/qgamepadmanager.cpp +++ b/src/gamepad/qgamepadmanager.cpp @@ -45,6 +45,19 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(gp, "qt.gamepad") +/*! + \class QGamepadManager + \inmodule QtGamepad + \brief Queries attached gamepads and related events. + + QGamepadManager provides a high-level interface for querying the attached + gamepads and events related to all of the connected devices. + */ + +/*! + * Constructor for QGamepadManager. + */ + QGamepadManager::QGamepadManager() : QObject(0) { @@ -66,6 +79,9 @@ QGamepadManager::QGamepadManager() : qCWarning(gp) << "Failed to start gamepad backend"; } +/*! + * Destructor for QGamepadManager. + */ QGamepadManager::~QGamepadManager() { m_gamepadBackend->stop(); |