IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

SensorGesture QML Type

Provides notifications when sensor-based gestures are detected.

This type was introduced in QtSensors 5.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

SensorGesture QML Type

  • Import Statement: import QtSensors 5.11

  • Since: QtSensors 5.0

Detailed Description

This type provides notification when sensor gestures are triggered.

The following QML code creates a "shake" and "SecondCounter" SensorGesture QML type, and displays the detected gesture in a text type.

QtSensors.shake gesture is available with the Qt Sensors API, but the QtSensors.SecondCounter sensor gesture is provided as example code for the Qt Sensors - SensorGesture QML Type example

 
Sélectionnez
Item {
   SensorGesture {
       id: sensorGesture
       enabled: false
       gestures : ["QtSensors.shake", "QtSensors.SecondCounter"]
       onDetected:{
           detectedText.text = gesture
       }
   }
   Text {
       id: detectedText
       x:5
       y:160
   }
}

Qt Sensor Gestures contains a list of currently supported sensor gestures and their descriptions.

Property Documentation

 

[read-only] availableGestures : stringlist

This property can be used to determine all available gestures on the system.

enabled : bool

This property can be used to activate or deactivate the sensor gesture. Default value is false;

See Also

gestures : stringlist

Set this property to a list of the gestures that the application is interested in detecting. This property cannot be changed while the type is enabled.

The properties validGestures and invalidGestures will be set as appropriate immediately. To determine all available getures on the system please use the availableGestures property.

See Also

[read-only] invalidGestures : stringlist

This property holds the requested gestures that were not found on the system.

[read-only] validGestures : stringlist

This property holds the requested gestures that were found on the system.

Signal Documentation

 

detected(string gesture)

This signal is emitted whenever a gesture is detected. The gesture parameter contains the gesture that was detected.

The corresponding handler is onDetected.

The corresponding handler is onDetected.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+