QtMobility Reference Documentation

QFeedbackActuator Class Reference

The QFeedbackActuator class describes actuators for tactile feedback. More...

 #include <QFeedbackActuator>

Inherits: QObject.

This class was introduced in Qt Mobility 1.1.

Public Types

enum Capability { Envelope, Period }
enum State { Busy, Ready, Unknown }

Properties

  • state : const QFeedbackActuator::State
  • valid : const bool
  • 1 property inherited from QObject

Public Functions

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
  • 29 public functions inherited from QObject

Signals

void enabledChanged ()

Static Public Members

QList<QFeedbackActuator *> actuators ()
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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.

Member Type Documentation

enum QFeedbackActuator::Capability

ConstantValueDescription
QFeedbackActuator::Envelope0Capability defining the wave type with attack/fade times and levels.
QFeedbackActuator::Period1Capability defining that the device can play periodic effects.

enum QFeedbackActuator::State

ConstantValueDescription
QFeedbackActuator::Busy0The actuator is busy.
QFeedbackActuator::Ready1The actuator is ready to play an effect.
QFeedbackActuator::Unknown2The actuator is in an unknown state.

Property Documentation

enabled : bool

This property holds whether the feedback actuator is enabled.

Access functions:

bool isEnabled () const
void setEnabled ( bool enabled )

Notifier signal:

void enabledChanged ()

id : const int

This property holds id of the feedback actuator.

Access functions:

int id () const

name : const QString

This property holds name of the feedback actuator.

Access functions:

QString name () const

state : const QFeedbackActuator::State

This property holds state of the feedback actuator.

Access functions:

State state () const

valid : const bool

This property holds validity of the feedback actuator.

Access functions:

bool isValid () const

Member Function Documentation

QFeedbackActuator::QFeedbackActuator ( QObject * parent = 0 )

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().

QList<QFeedbackActuator *> QFeedbackActuator::actuators () [static]

Returns the list of actuators available on the system.

void QFeedbackActuator::enabledChanged () [signal]

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().

bool QFeedbackActuator::isCapabilitySupported ( Capability capability ) const

Returns if the actuator supports the supplied capability.

This function was introduced in Qt Mobility 1.1.

bool QFeedbackActuator::operator== ( const QFeedbackActuator & other ) const

Returns true if this actuator is equal to other.

This function was introduced in Qt Mobility 1.1.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.