QGestureEvent Class
QGestureEvent クラスは、トリガーされたジェスチャーの説明を提供します。詳細...
ヘッダー | #include <QGestureEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
継承: | QEvent |
- 継承メンバを含む全メンバのリスト
- QGestureEventはEventクラスの一部です。
パブリック関数
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 |
詳細な説明
QGestureEvent クラスには、gestures() 関数を使用して取得できるジェスチャーのリストが含まれています。
ジェスチャーは、アクティブまたはキャンセルされます。現在実行されているジェスチャのリストは、activeGestures() 関数を使用して取得できます。canceledGestures ()関数を使用すると、以前にアクティブでキャンセルされたジェスチャーのリストにアクセスできます。ジェスチャがキャンセルされるのは、現在のウィンドウのフォーカスが外れた場合、タイムアウトが発生した場合などです。
イベント・ハンドラが一般的なQEvent::accept() 関数を呼び出すことによってイベントを受け入れない場合、Qt::GestureStarted 状態で受け入れない個々のQGesture オブジェクトはすべて、ウィジェットがそれぞれQGestureEvent::accept() を呼び出すことによってそれらを個別に受け入れるか、イベント・フィルタがイベントを消費するまで、親ウィジェット・チェーンに伝搬されます。
参考文献
Qt におけるジェスチャ処理の概要と、アプリケーションでジェスチャを使用する方法については、「Gestures in Widgets and Graphics View」を参照してください。
QGesture,QGestureRecognizer,QWidget::grabGesture(),QGraphicsObject::grabGesture()も参照して ください。
メンバ関数のドキュメント
[explicit]
QGestureEvent::QGestureEvent(const QList<QGesture *> &gestures)
gestures のリストを含む新しい QGestureEvent を作成します。
[virtual noexcept]
QGestureEvent::~QGestureEvent()
QGestureEvent を破壊する。
void QGestureEvent::accept(QGesture *gesture)
gesture setAccepted(gesture, true) を呼び出すのと同じです。
accept フラグを設定すると、イベント受信者がそのジェスチャを望んでいることを示します。不要なジェスチャは、親ウィジェットに伝搬される可能性があります。
QGestureEvent::ignore()も参照してください 。
void QGestureEvent::accept(Qt::GestureType gestureType)
gestureType setAccepted(gestureType, true) を呼び出すのと同じです。
accept フラグの設定は、イベント受信者がジェスチャを望んでいることを示します。不要なジェスチャは、親ウィジェットに伝搬される場合があります。
QGestureEvent::ignore()も参照してください 。
QList<QGesture *> QGestureEvent::activeGestures() const
アクティブな(キャンセルされていない)ジェスチャーのリストを返します。
QList<QGesture *> QGestureEvent::canceledGestures() const
キャンセルされたジェスチャーのリストを返します。
QGesture *QGestureEvent::gesture(Qt::GestureType type) const
type によってジェスチャーオブジェクトを返します。
QList<QGesture *> QGestureEvent::gestures() const
イベントで配信されたすべてのジェスチャーを返します。
void QGestureEvent::ignore(QGesture *gesture)
gesture setAccepted(gesture, false) を呼び出すのと同じです。
accept フラグをクリアすることは、イベント受信者がジェスチャを望んでいないことを示します。不要なジェスチャは親ウィジェットに伝搬される可能性があります。
QGestureEvent::accept()も参照してください 。
void QGestureEvent::ignore(Qt::GestureType gestureType)
gestureType setAccepted(gesture, false)を呼び出すのと同じです。
accept フラグをクリアすることは、イベント受信者がジェスチャを望んでいないことを示します。不要なジェスチャは、親ウィジェットに伝搬される場合があります。
QGestureEvent::accept()も参照してください 。
bool QGestureEvent::isAccepted(QGesture *gesture) const
gesture が受け入れられた場合はtrue
を返し、そうでない場合はfalse
を返す。
bool QGestureEvent::isAccepted(Qt::GestureType gestureType) const
gestureType 型のジェスチャーが受け入れられる場合はtrue
を返し、そうでない場合はfalse
を返す。
QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const
gesturePoint がグラフィックビュー内にある場合、シーンローカル座標を返します。
この関数は、ジェスチャーイベントがQGraphicsObject に配信され、スクリーン座標の点をシーンローカル座標に変換するときに便利です。
QPointF::isNull()も参照してください 。
void QGestureEvent::setAccepted(QGesture *gesture, bool value)
与えられたgesture オブジェクトのアクセプトフラグを、指定されたvalue に設定します。
アクセプトフラグの設定は、イベント受信者がgesture を望んでいることを示します。 望まれていないジェスチャは、親ウィジェットに伝搬される可能性があります。
デフォルトでは、QEvent::Gesture タイプのイベントのジェスチャは受け入れられ、QEvent::GestureOverride イベントのジェスチャは無視されます。
便宜上、accept(gesture) で accept フラグを設定し、ignore(gesture) でクリアすることもできます。
isAccepted()も参照してください 。
void QGestureEvent::setAccepted(Qt::GestureType gestureType, bool value)
与えられたgestureType オブジェクトのアクセプトフラグを、指定されたvalue に設定する。
アクセプトフラグの設定は、イベントレシーバが指定されたタイプのジェスチャの受信を望んでいることを示しますgestureType 。不要なジェスチャは、親ウィジェットに伝搬される可能性があります。
デフォルトでは、QEvent::Gesture タイプのイベントのジェスチャは受け入れられ、QEvent::GestureOverride イベントのジェスチャは無視されます。
便宜上、accept(gestureType) で accept フラグを設定し、ignore(gestureType) でクリアすることもできます。
QWidget *QGestureEvent::widget() const
イベントが発生したウィジェットを返します。
© 2025 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 the GNU 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.