The QFeedbackActuator class describes actuators for tactile feedback. More...
#include <QFeedbackActuator>
Inherits: QObject.
This class was introduced in Qt Mobility 1.1.
enum | Capability { Envelope, Period } |
enum | State { Busy, Ready, Unknown } |
QFeedbackActuator ( QObject * parent = 0 ) | |
int | id () const |
bool | isCapabilitySupported ( Capability capability ) const |
bool | isEnabled () const |
bool | isValid () const |
QString | name () const |
void | setEnabled ( bool enabled ) |
State | state () const |
bool | operator== ( const QFeedbackActuator & other ) const |
void | enabledChanged () |
QList<QFeedbackActuator *> | actuators () |
The QFeedbackActuator class describes actuators for tactile feedback.
An actuator knows how to play a tactile effect. The class gives access to a specified actuator.
An actuator can be used to play QFeedbackHapticsEffects using setActuator(). Usually, you will not have to set an actuator directly on a QFeedbackHapticsEffect. QFeedbackHapticsEffect and QFeedbackFileEffect uses an appropriate actuator by default. However, you can query which actuators are available with actuators().
QFeedbackActuator actuator; // default system actuator QList<QFeedbackActuator> actuators = QFeedbackActuator::actuators(); foreach (const QFeedbackActuator& temp, actuators) { if (temp.name() == "ExampleActuatorName") { actuator = temp; } }
The QFeedbackActuator class gives access to information about the actuator it represents. You can query if the actuator is enabled and if it is valid . Whether an actuator is ready to play an effect can be queried by checking the actuator's state(). The State enum describes the states and actuator can have. You can also get a human readable name for the actuator with the name() function.
See also QFeedbackHapticsEffect, QFeedbackFileEffect, and QFeedbackEffect.
Constant | Value | Description |
---|---|---|
QFeedbackActuator::Envelope | 0 | Capability defining the wave type with attack/fade times and levels. |
QFeedbackActuator::Period | 1 | Capability defining that the device can play periodic effects. |
Constant | Value | Description |
---|---|---|
QFeedbackActuator::Busy | 0 | The actuator is busy. |
QFeedbackActuator::Ready | 1 | The actuator is ready to play an effect. |
QFeedbackActuator::Unknown | 2 | The actuator is in an unknown state. |
This property holds whether the feedback actuator is enabled.
Access functions:
bool | isEnabled () const |
void | setEnabled ( bool enabled ) |
Notifier signal:
void | enabledChanged () |
This property holds id of the feedback actuator.
Access functions:
int | id () const |
This property holds name of the feedback actuator.
Access functions:
QString | name () const |
This property holds state of the feedback actuator.
Access functions:
State | state () const |
This property holds validity of the feedback actuator.
Access functions:
bool | isValid () const |
Constructs a QFeedbackActuator, passing parent to the QObject constructor.
The object will represent the default actuator on the system. If there are no actuators attached to the system, isValid() will return false.
See also isValid().
Returns the list of actuators available on the system.
This signal is emitted when the actuator is requested to enable or disable itself.
This function was introduced in Qt Mobility 1.1.
See also isEnabled().
Returns if the actuator supports the supplied capability.
This function was introduced in Qt Mobility 1.1.
Returns true if this actuator is equal to other.
This function was introduced in Qt Mobility 1.1.