Home · All Classes · Overviews

QPinchGesture Class Reference
[QtGui module]

The QPinchGesture class represents a Pinch gesture, providing additional information related to zooming and/or rotation. More...

 #include <QPinchGesture>

Inherits QGesture.

This class was introduced in Qt 4.6.


Public Types

enum WhatChange { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged }
flags WhatChanged

Properties


Public Functions

QPinchGesture ( QWidget * gestureTarget, QObject * parent = 0 )
QPointF centerPoint () const
QPointF lastCenterPoint () const
qreal lastRotationAngle () const
qreal lastScaleFactor () const
qreal rotationAngle () const
qreal scaleFactor () const
QPointF startCenterPoint () const
qreal totalRotationAngle () const
qreal totalScaleFactor () const
WhatChanged whatChanged () const

Additional Inherited Members


Detailed Description

The QPinchGesture class represents a Pinch gesture, providing additional information related to zooming and/or rotation.


Member Type Documentation

enum QPinchGesture::WhatChange
flags QPinchGesture::WhatChanged

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


Property Documentation

centerPoint : const QPointF

Specifies a center point of the gesture. The point can be used as a center point that the object is rotated around.

Access functions:

QPointF centerPoint () const

lastCenterPoint : const QPointF

Specifies a previous center point of the gesture.

Access functions:

QPointF lastCenterPoint () const

lastRotationAngle : const qreal

Specifies a previous rotation angle of the gesture.

The angle is specified in degrees.

Access functions:

qreal lastRotationAngle () const

lastScaleFactor : const qreal

Specifies a previous scale factor of the pinch gesture.

Access functions:

qreal lastScaleFactor () const

rotationAngle : const qreal

Specifies a rotation angle of the gesture.

If the gesture consists of several pinch sequences (i.e. zoom and rotate sequences), then this property specifies the rotation angle in the current sequence. When pinching changes the scale factor only, the value of this property is 0.

The angle is specified in degrees.

Access functions:

qreal rotationAngle () const

scaleFactor : const qreal

Specifies a scale factor of the pinch gesture.

If the gesture consists of several pinch sequences (i.e. zoom and rotate sequences), then this property specifies the scale factor in the current sequence. When pinching changes the rotation angle only, the value of this property is 1.

Access functions:

qreal scaleFactor () const

startCenterPoint : const QPointF

Specifies an initial center point of the gesture. Difference between the startCenterPoint and the centerPoint is the distance at which pinching fingers has shifted.

Access functions:

QPointF startCenterPoint () const

totalRotationAngle : const qreal

Specifies a total rotation angle of the gesture since the gesture started.

The angle is specified in degrees.

Access functions:

qreal totalRotationAngle () const

totalScaleFactor : const qreal

Specifies a total scale factor of the pinch gesture since the gesture started.

Access functions:

qreal totalScaleFactor () const

whatChanged : const WhatChanged

Specifies which values were changed in the gesture.

Access functions:

WhatChanged whatChanged () const

Member Function Documentation

QPinchGesture::QPinchGesture ( QWidget * gestureTarget, QObject * parent = 0 )

Creates a new Pinch gesture handler object and marks it as a child of parent. The pan gesture handler watches gestureTarget for its events.

On some platform like Windows it's necessary to provide a non-null widget as parent to get native gesture support.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.6.0-tp1