Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QPinchGesture Class

TheQPinchGesture class describes a pinch gesture made by the user.More...

Header:#include <QPinchGesture>
Since: Qt 4.6
Inherits:QGesture

Public Types

enumChangeFlag { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged }
flagsChangeFlags

Properties

Public Functions

QPointFcenterPoint() const
ChangeFlagschangeFlags() const
QPointFlastCenterPoint() const
qreallastRotationAngle() const
qreallastScaleFactor() const
qrealrotationAngle() const
qrealscaleFactor() const
voidsetCenterPoint(const QPointF & value)
voidsetChangeFlags(ChangeFlags value)
voidsetLastCenterPoint(const QPointF & value)
voidsetLastRotationAngle(qreal value)
voidsetLastScaleFactor(qreal value)
voidsetRotationAngle(qreal value)
voidsetScaleFactor(qreal value)
voidsetStartCenterPoint(const QPointF & value)
voidsetTotalChangeFlags(ChangeFlags value)
voidsetTotalRotationAngle(qreal value)
voidsetTotalScaleFactor(qreal value)
QPointFstartCenterPoint() const
ChangeFlagstotalChangeFlags() const
qrealtotalRotationAngle() const
qrealtotalScaleFactor() const
  • 8 public functions inherited fromQGesture
  • 29 public functions inherited fromQObject

Additional Inherited Members

  • 1 public slot inherited fromQObject
  • 1 signal inherited fromQObject
  • 7 static public members inherited fromQObject
  • 8 protected functions inherited fromQObject

Detailed Description

TheQPinchGesture 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 theGestures 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 ofQPinchGesture in theQt::GestureUpdated state.

See alsoQPanGesture andQSwipeGesture.

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 byscaleFactor changed.
QPinchGesture::RotationAngleChanged0x2The rotation angle held byrotationAngle changed.
QPinchGesture::CenterPointChanged0x4The center point held bycenterPoint changed.

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

See alsochangeFlags andtotalChangeFlags.

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:

QPointFcenterPoint() const
voidsetCenterPoint(const QPointF & value)

See alsostartCenterPoint andlastCenterPoint.

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:

ChangeFlagschangeFlags() const
voidsetChangeFlags(ChangeFlags value)

See alsototalChangeFlags,scaleFactor,rotationAngle, andcenterPoint.

lastCenterPoint :QPointF

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

Access functions:

QPointFlastCenterPoint() const
voidsetLastCenterPoint(const QPointF & value)

See alsocenterPoint andstartCenterPoint.

lastRotationAngle :qreal

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

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

Access functions:

qreallastRotationAngle() const
voidsetLastRotationAngle(qreal value)

See alsorotationAngle andtotalRotationAngle.

lastScaleFactor :qreal

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

The last scale factor contains the scale factor reported in thescaleFactor 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:

qreallastScaleFactor() const
voidsetLastScaleFactor(qreal value)

See alsoscaleFactor andtotalScaleFactor.

rotationAngle :qreal

This property holds the angle covered by the gesture motion.

Access functions:

qrealrotationAngle() const
voidsetRotationAngle(qreal value)

See alsototalRotationAngle andlastRotationAngle.

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:

qrealscaleFactor() const
voidsetScaleFactor(qreal value)

See alsototalScaleFactor andlastScaleFactor.

startCenterPoint :QPointF

This property holds the starting position of the center point.

Access functions:

QPointFstartCenterPoint() const
voidsetStartCenterPoint(const QPointF & value)

See alsocenterPoint andlastCenterPoint.

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:

ChangeFlagstotalChangeFlags() const
voidsetTotalChangeFlags(ChangeFlags value)

See alsochangeFlags,scaleFactor,rotationAngle, andcenterPoint.

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 therotationAngle 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:

qrealtotalRotationAngle() const
voidsetTotalRotationAngle(qreal value)

See alsorotationAngle andlastRotationAngle.

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:

qrealtotalScaleFactor() const
voidsetTotalScaleFactor(qreal value)

See alsoscaleFactor andlastScaleFactor.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp