QGestureEvent 類提供觸發手勢的描述。 更多...
| 頭: | #include <QGestureEvent> |
| qmake: | QT += widgets |
| Since: | Qt 4.6 |
| 繼承: | QEvent |
該類在 Qt 4.6 引入。
| QGestureEvent (const QList<QGesture *> & gestures ) | |
| virtual | ~QGestureEvent () |
| void | accept (QGesture * gesture ) |
| void | accept (Qt::GestureType gestureType ) |
| QList<QGesture *> | activeGestures () const |
| QList<QGesture *> | canceledGestures () const |
| QGesture * | gesture (Qt::GestureType type ) const |
| QList<QGesture *> | gestures () const |
| void | ignore (QGesture * gesture ) |
| void | ignore (Qt::GestureType gestureType ) |
| bool | isAccepted (QGesture * gesture ) const |
| bool | isAccepted (Qt::GestureType gestureType ) const |
| QPointF | mapToGraphicsScene (const QPointF & gesturePoint ) const |
| void | setAccepted (QGesture * gesture , bool value ) |
| void | setAccepted (Qt::GestureType gestureType , bool value ) |
| QWidget * | widget () const |
The QGestureEvent class contains a list of gestures, which can be obtained using the gestures () 函數。
手勢要麼活動,要麼被取消。可以獲得目前正執行的那些列錶使用 activeGestures () 函數。可以訪問先前活動並已被取消的那些列錶使用 canceledGestures () 函數。手勢可能被取消,例如,若當前窗口丟失聚焦,或因為超時或齣於其它原因。
若事件處理程序不接受事件通過調用一般 QEvent::accept () 函數,所有單個 QGesture 對象不被接受和在 Qt::GestureStarted 狀態將嚮上傳播到父級 Widget 鏈,直到 Widget 單獨接受它們為止,通過調用 QGestureEvent::accept () 對於它們中的每個,或事件過濾器消耗事件。
Qt 中手勢處理的概述和在應用程序中使用手勢的有關信息,見 Widget 和圖形視圖中的手勢 文檔。
另請參閱 QGesture , QGestureRecognizer , QWidget::grabGesture (),和 QGraphicsObject::grabGesture ().
創建新的 QGestureEvent 包含列錶 gestures .
[虛擬]
QGestureEvent::
~QGestureEvent
()
銷毀 QGestureEvent .
設置接受標誌為給定 gesture 對象,相當於調用 setAccepted(gesture, true) .
設置接受標誌指示事件接收者想要的手勢。不想要的手勢可能會被傳播給父級 Widget。
另請參閱 QGestureEvent::ignore ().
設置接受標誌為給定 gestureType ,相當於調用 setAccepted(gestureType, true) .
設置接受標誌指示事件接收者想要的手勢。不想要的手勢可能會被傳播給父級 Widget。
另請參閱 QGestureEvent::ignore ().
返迴活動 (未被取消) 手勢的列錶。
返迴被取消手勢的列錶。
返迴手勢對象按 type .
返迴在事件中交付的所有手勢。
清零接受標誌參數為給定 gesture 對象,相當於調用 setAccepted(gesture, false) .
清零接受標誌指示事件接收者不想要的手勢。不想要的手勢可能會被傳播給父級 Widget。
另請參閱 QGestureEvent::accept ().
清零接受標誌參數為給定 gestureType ,相當於調用 setAccepted(gesture, false) .
清零接受標誌指示事件接收者不想要的手勢。不想要的手勢可能會被傳播給父級 Widget。
另請參閱 QGestureEvent::accept ().
返迴
true
若
gesture
被接受;否則返迴
false
.
返迴
true
若手勢的類型
gestureType
被接受;否則返迴
false
.
返迴場景局部坐標若 gesturePoint 在圖形視圖內。
此功能可能有用,當手勢事件被交付給 QGraphicsObject 以將屏幕坐標點翻譯成場景局部坐標。
另請參閱 QPointF::isNull ().
設置接受標誌為給定 gesture 對象到指定 value .
設置接受標誌指示事件接收者想要的 gesture 。不想要的手勢可能會被傳播給父級 Widget。
默認情況下, 事件手勢類型為 QEvent::Gesture 接受,和手勢為 QEvent::GestureOverride 事件被忽略。
為方便起見,還可以設置接受標誌采用 accept (gesture),和清零采用 ignore (gesture).
另請參閱 isAccepted ().
設置接受標誌為給定 gestureType 對象到指定 value .
設置接受標誌指示事件接收者想要接收的指定類型手勢 gestureType 。不想要的手勢可能會被傳播給父級 Widget。
默認情況下, 事件手勢類型為 QEvent::Gesture 接受,和手勢為 QEvent::GestureOverride 事件被忽略。
為方便起見,還可以設置接受標誌采用 accept (gestureType),和清零采用 ignore (gestureType).
返迴事件在其中發生的 Widget。