Notice: Undefined offset: 1 in /home/developpez/www/developpez-com/upload/qt/doc/redir.php on line 39 Qt 4.7: QPinchGesture Class Reference
Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QPinchGesture Class Reference

The QPinchGesture class describes a pinch gesture made by the user. More...

 #include <QPinchGesture>

Inherits: QGesture.

This class was introduced in Qt 4.6.

Public Types

enum ChangeFlag { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged }
flags ChangeFlags

Properties

Public Functions

QPointF centerPoint () const
ChangeFlags changeFlags () const
QPointF lastCenterPoint () const
qreal lastRotationAngle () const
qreal lastScaleFactor () const
qreal rotationAngle () const
qreal scaleFactor () const
void setCenterPoint ( const QPointF & value )
void setChangeFlags ( ChangeFlags value )
void setLastCenterPoint ( const QPointF & value )
void setLastRotationAngle ( qreal value )
void setLastScaleFactor ( qreal value )
void setRotationAngle ( qreal value )
void setScaleFactor ( qreal value )
void setStartCenterPoint ( const QPointF & value )
void setTotalChangeFlags ( ChangeFlags value )
void setTotalRotationAngle ( qreal value )
void setTotalScaleFactor ( qreal value )
QPointF startCenterPoint () const
ChangeFlags totalChangeFlags () const
qreal totalRotationAngle () const
qreal totalScaleFactor () const
  • 8 public functions inherited from QGesture
  • 29 public functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 5 static public members inherited from QObject
  • 7 protected functions inherited from QObject

Detailed Description

The QPinchGesture class describes a pinch gesture made by the user.

A pinch gesture is a form of touch user input in which the user typically touches two points on the input device with a thumb and finger, before moving them closer together or further apart to change the scale factor, zoom, or level of detail of the user interface.

For an overview of gesture handling in Qt and information on using gestures in your applications, see the Gestures Programming document.

Instead of repeatedly applying the same pinching gesture, the user may continue to touch the input device in one place, and apply a second touch to a new point, continuing the gesture. When this occurs, gesture events will continue to be delivered to the target object, containing an instance of QPinchGesture in the Qt::GestureUpdated state.

See also QPanGesture and QSwipeGesture.

Member Type Documentation

enum QPinchGesture::ChangeFlag
flags QPinchGesture::ChangeFlags

This enum describes the changes that can occur to the properties of the gesture object.

ConstantValueDescription
QPinchGesture::ScaleFactorChanged0x1The scale factor held by scaleFactor changed.
QPinchGesture::RotationAngleChanged0x2The rotation angle held by rotationAngle changed.
QPinchGesture::CenterPointChanged0x4The center point held by centerPoint changed.

The ChangeFlags type is a typedef for QFlags<ChangeFlag>. It stores an OR combination of ChangeFlag values.

See also changeFlags and totalChangeFlags.

Property Documentation

centerPoint : QPointF

This property holds the current center point.

The center point is the midpoint between the two input points in the gesture.

Access functions:

QPointF centerPoint () const
void setCenterPoint ( const QPointF & value )

See also startCenterPoint and lastCenterPoint.

changeFlags : ChangeFlags

This property holds the property of the gesture that has changed in the current step.

This property indicates which of the other properties has changed since the previous gesture event included information about this gesture. You can use this information to determine which aspect of your user interface needs to be updated.

Access functions:

ChangeFlags changeFlags () const
void setChangeFlags ( ChangeFlags value )

See also totalChangeFlags, scaleFactor, rotationAngle, and centerPoint.

lastCenterPoint : QPointF

This property holds the last position of the center point recorded for this gesture.

Access functions:

QPointF lastCenterPoint () const
void setLastCenterPoint ( const QPointF & value )

See also centerPoint and startCenterPoint.

lastRotationAngle : qreal

This property holds the last reported angle covered by the gesture motion.

The last rotation angle is the angle as reported in the rotationAngle property when a previous gesture event was delivered for this gesture.

Access functions:

qreal lastRotationAngle () const
void setLastRotationAngle ( qreal value )

See also rotationAngle and totalRotationAngle.

lastScaleFactor : qreal

This property holds the last scale factor recorded for this gesture.

The last scale factor contains the scale factor reported in the scaleFactor property when a previous gesture event included information about this gesture.

If no previous event was delivered with information about this gesture (i.e., this gesture object contains information about the first movement in the gesture) then this property contains zero.

Access functions:

qreal lastScaleFactor () const
void setLastScaleFactor ( qreal value )

See also scaleFactor and totalScaleFactor.

rotationAngle : qreal

This property holds the angle covered by the gesture motion.

Access functions:

qreal rotationAngle () const
void setRotationAngle ( qreal value )

See also totalRotationAngle and lastRotationAngle.

scaleFactor : qreal

This property holds the current scale factor.

The scale factor measures the scale factor associated with the distance between two of the user's inputs on a touch device.

Access functions:

qreal scaleFactor () const
void setScaleFactor ( qreal value )

See also totalScaleFactor and lastScaleFactor.

startCenterPoint : QPointF

This property holds the starting position of the center point.

Access functions:

QPointF startCenterPoint () const
void setStartCenterPoint ( const QPointF & value )

See also centerPoint and lastCenterPoint.

totalChangeFlags : ChangeFlags

This property holds the property of the gesture that has change.

This property indicates which of the other properties has changed since the gesture has started. You can use this information to determine which aspect of your user interface needs to be updated.

Access functions:

ChangeFlags totalChangeFlags () const
void setTotalChangeFlags ( ChangeFlags value )

See also changeFlags, scaleFactor, rotationAngle, and centerPoint.

totalRotationAngle : qreal

This property holds the total angle covered by the gesture.

This total angle measures the complete angle covered by the gesture. Usually, this is equal to the value held by the rotationAngle property, except in the case where the user performs multiple rotations by removing and repositioning one of the touch points, as described above. In this case, the total angle will be the sum of the rotation angles for the multiple stages of the gesture.

Access functions:

qreal totalRotationAngle () const
void setTotalRotationAngle ( qreal value )

See also rotationAngle and lastRotationAngle.

totalScaleFactor : qreal

This property holds the total scale factor.

The total scale factor measures the total change in scale factor from the original value to the current scale factor.

Access functions:

qreal totalScaleFactor () const
void setTotalScaleFactor ( qreal value )

See also scaleFactor and lastScaleFactor.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 53
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  4. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web