QEventPoint Class
QEventPointクラスは、QPointerEvent のポイントに関する情報を提供する。
ヘッダー | #include <QEventPoint> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
以来: | Qt 6.0 |
パブリックタイプ
プロパティ
|
|
パブリック機能
QEventPoint(int pointId, QEventPoint::State state, const QPointF &scenePosition, const QPointF &globalPosition) | |
QEventPoint(const QEventPoint &other) | |
QEventPoint(QEventPoint &&other) | |
~QEventPoint() | |
const QPointingDevice * | device() const |
QSizeF | ellipseDiameters() const |
QPointF | globalGrabPosition() const |
QPointF | globalLastPosition() const |
QPointF | globalPosition() const |
QPointF | globalPressPosition() const |
QPointF | grabPosition() const |
int | id() const |
bool | isAccepted() const |
QPointF | lastPosition() const |
ulong | lastTimestamp() const |
QPointF | normalizedPosition() const |
QPointF | position() const |
QPointF | pressPosition() const |
ulong | pressTimestamp() const |
qreal | pressure() const |
qreal | rotation() const |
QPointF | sceneGrabPosition() const |
QPointF | sceneLastPosition() const |
QPointF | scenePosition() const |
QPointF | scenePressPosition() const |
void | setAccepted(bool accepted = true) |
QEventPoint::State | state() const |
qreal | timeHeld() const |
ulong | timestamp() const |
QPointingDeviceUniqueId | uniqueId() const |
QVector2D | velocity() const |
bool | operator!=(const QEventPoint &other) const |
QEventPoint & | operator=(QEventPoint &&other) |
QEventPoint & | operator=(const QEventPoint &other) |
bool | operator==(const QEventPoint &other) const |
メンバ型ドキュメント
enum QEventPoint::State
flags QEventPoint::States
このイベントポイントの状態を指定します。
定数 | 値 | 説明 |
---|---|---|
QEventPoint::Unknown | Qt::TouchPointUnknownState | 不明な状態。 |
QEventPoint::Stationary | Qt::TouchPointStationary | イベント ポイントは移動していません。 |
QEventPoint::Pressed | Qt::TouchPointPressed | タッチポイントまたはボタンが押された。 |
QEventPoint::Updated | Qt::TouchPointMoved | イベントポイントが更新された。 |
QEventPoint::Released | Qt::TouchPointReleased | タッチ・ポイントまたはボタンが離された。 |
States型はQFlags<State>のtypedefである。これは、State値のORの組み合わせを格納する。
プロパティの説明
accepted : bool
このプロパティは、イベントポイントの受け入れ状態を保持する。
ウィジェットベースのアプリケーションでは、このプロパティは使用されない。なぜなら、ウィジェットが完全なQInputEvent を受け入れるか拒否することにしか意味がないからである。
しかしQt Quick では、Item や Event Handler は、QTouchEvent の中で、実際にジェスチャーに参加している個々のポイントだけを受け入れるのが普通であり、他のポイントは他のアイテムやハンドラに渡すことができる。一貫性を保つために、これはどのようなQPointerEvent にも適用され、QPointerEvent のすべてのポイントが受け入れられたときにのみ配送が行われる。
アクセス関数:
bool | isAccepted() const |
void | setAccepted(bool accepted = true) |
QEvent::acceptedも参照のこと 。
[read-only]
device : const QPointingDevice*
このプロパティは、このイベントポイントが発生したポインティングデバイスを保持する。
アクセス関数:
const QPointingDevice * | device() const |
[read-only]
ellipseDiameters : const QSizeF
このプロパティは、タッチ点の外接楕円の幅と高さを保持する。
戻り値は論理ピクセル単位である。ほとんどのタッチスクリーンは接触点の形状を検出せず、マウスやタブレットデバイスも検出できないため、NULLサイズが最も一般的な値です。タッチスクリーンによっては、直径が0でなく常に等しい場合があります(楕円は円として近似されます)。
アクセス関数:
QSizeF | ellipseDiameters() const |
[read-only]
globalGrabPosition : const QPointF
このプロパティは、この点がつかまれたグローバル位置を保持する。
グローバル位置は、スクリーンまたは仮想デスクトップからの相対位置である。
アクセス関数:
QPointF | globalGrabPosition() const |
globalPosition 、grabPosition 、sceneGrabPositionも参照してください 。
[read-only]
globalLastPosition : const QPointF
このプロパティは、前の押下または移動イベントからのこの点のグローバル位置を保持する。
グローバル位置は、スクリーンまたは仮想デスクトップからの相対位置です。
アクセス関数:
QPointF | globalLastPosition() const |
globalPosition 、lastPosition 、sceneLastPositionも参照してください 。
[read-only]
globalPosition : const QPointF
このプロパティは、この点のグローバル位置を保持する。
グローバル位置は、スクリーンまたは仮想デスクトップからの相対位置である。
アクセス関数:
QPointF | globalPosition() const |
globalPressPosition 、position 、scenePositionも参照してください 。
[read-only]
globalPressPosition : const QPointF
このプロパティは、このポイントが押されたグローバル位置を保持する。
グローバル位置は、スクリーンまたは仮想デスクトップからの相対位置である。
アクセス関数:
QPointF | globalPressPosition() const |
globalPosition 、pressPosition 、scenePressPositionも参照してください 。
[read-only]
grabPosition : const QPointF
このプロパティは、このポイントが掴まれた位置を保持する。
この位置は、イベントを受信したウィジェットまたはアイテムからの相対位置である。
アクセス関数:
QPointF | grabPosition() const |
positionも参照してください 。
[read-only]
id : const int
このプロパティは、このイベントポイントの ID 番号を保持する。
注意: ID番号がゼロから始まったり、連続していると仮定しないでください。そのような仮定は、基礎となるドライバの動作方法によって、しばしば誤りである。
アクセス関数:
int | id() const |
[read-only]
lastPosition : const QPointF
このプロパティは、前回の押下または移動イベントからのこのポイントの位置を保持する。
位置は、イベントを受信したウィジェットまたはアイテムからの相対位置です。
アクセス関数:
QPointF | lastPosition() const |
position およびpressPositionも参照してください 。
[read-only]
lastTimestamp : const ulong
このプロパティは、この点を含む前のQPointerEvent からの時間を保持する。
アクセス関数:
ulong | lastTimestamp() const |
globalLastPositionも参照のこと 。
[read-only]
position : const QPointF
このプロパティは、この点の位置を保持する。
位置は、イベントを受信したウィジェットまたはアイテムからの相対位置である。
アクセス関数
QPointF | position() const |
[read-only]
pressPosition : const QPointF
このプロパティは、このポイントが押された位置を保持する。
この位置は、イベントを受信したウィジェットまたはアイテムからの相対位置である。
アクセス関数:
QPointF | pressPosition() const |
positionも参照してください 。
[read-only]
pressTimestamp : const ulong
このプロパティは、このポイントが押された最新の時刻を保持する。
アクセス関数:
ulong | pressTimestamp() const |
timestampも参照のこと 。
[read-only]
pressure : const qreal
このプロパティは、この点の圧力を保持する。
戻り値は0.0
から1.0
の範囲である。
アクセス関数:
qreal | pressure() const |
[read-only]
rotation : const qreal
このプロパティは、この点の角度の向きを保持する。
戻り値は度単位で、ゼロ(デフォルト)は指、トークン、またはスタイラスが上を向いていることを示し、負の角度は左に回転していることを、正の角度は右に回転していることを意味します。ほとんどのタッチスクリーンは回転を検出しないため、ゼロが最も一般的な値です。
関数にアクセスします:
qreal | rotation() const |
[read-only]
sceneGrabPosition : const QPointF
このプロパティは、この点が掴まれたシーン位置を保持する。
シーン位置は、QQuickItem::event() で処理される場合はQQuickWindow からの相対位置、QGraphicsItem::touchEvent() のオーバーライドで処理される場合はQGraphicsScene 座標、ウィジェットアプリケーションではウィンドウ位置となります。
アクセス関数:
QPointF | sceneGrabPosition() const |
scenePosition 、grabPosition 、およびglobalGrabPositionも参照してください 。
[read-only]
sceneLastPosition : const QPointF
このプロパティは、前の押下または移動イベントからのこの点のシーン位置を保持する。
シーン位置は、QQuickItem::event() で処理される場合はQQuickWindow からの相対位置、QGraphicsItem::touchEvent() のオーバーライドで処理される場合はQGraphicsScene 座標、ウィジェット・アプリケーションではウィンドウ位置となります。
アクセス関数:
QPointF | sceneLastPosition() const |
scenePosition およびscenePressPositionも参照してください 。
[read-only]
scenePosition : const QPointF
このプロパティは、この点のシーン位置を保持する。
シーン位置は、QQuickItem::event() で処理される場合はQQuickWindow からの相対位置で、QGraphicsItem::touchEvent() のオーバーライドで処理される場合はQGraphicsScene 座標で、ウィジェット・アプリケーションではウィンドウ位置です。
アクセス関数:
QPointF | scenePosition() const |
scenePressPosition 、position 、およびglobalPositionも参照してください 。
[read-only]
scenePressPosition : const QPointF
このプロパティは、このポイントが押されたシーン位置を保持する。
シーン位置は、QQuickItem::event() で処理される場合はQQuickWindow からの相対位置、QGraphicsItem::touchEvent() のオーバーライドで処理される場合はQGraphicsScene 座標、ウィジェット・アプリケーションではウィンドウ位置となります。
アクセス関数:
QPointF | scenePressPosition() const |
scenePosition 、pressPosition 、およびglobalPressPositionも参照してください 。
[read-only]
state : const State
このプロパティは、イベントポイントの現在の状態を保持する。
アクセス関数:
QEventPoint::State | state() const |
[read-only]
timeHeld : const qreal
このプロパティは、このポイントが押されてから離されていない時間を秒単位で保持する。
アクセス関数:
qreal | timeHeld() const |
pressTimestamp およびtimestampも参照のこと 。
[read-only]
timestamp : const ulong
このプロパティは、このポイントがQPointerEvent に含まれた最新の時刻を保持する。
アクセス関数:
ulong | timestamp() const |
QPointerEvent::timestamp()も参照のこと 。
[read-only]
uniqueId : const QPointingDeviceUniqueId
このプロパティは、もしあれば、このポイントまたはトークンのユニークIDを保持する。
タッチスクリーンは指を一意に識別できないため、無効であることが多い(isValid ()を参照)。
このプロパティがQTabletEvent に由来する場合、使用中のスタイラスのシリアル番号を識別します。
TUIOドライバが特定のトークン(fiducial object)をサポートするタッチスクリーンで使用されている場合、特定のトークン(fiducial object)を識別することがあります。
アクセス機能:
QPointingDeviceUniqueId | uniqueId() const |
[read-only]
velocity : const QVector2D
このプロパティは、スクリーンまたはデスクトップの座標系における、ピクセル毎秒単位の速度ベクトルを保持する。
注意: デバイスの機能にQInputDevice::Velocity が含まれている場合、速度はオペレーティングシステムから提供されることを意味します(おそらく、タッチハードウェアまたはドライバが提供します)。しかし、通常、Velocity
の機能は設定されていません。これは、Qt が単純なカルマンフィルターを使って速度を計算し、瞬時の値ではなく平滑化された平均速度を提供していることを示しています。事実上、ユーザがこのポイントをドラッグした速度と方向がわかります。
アクセス関数:
QVector2D | velocity() const |
QInputDevice::capabilities() およびQInputEvent::device()も参照 。
メンバ関数ドキュメント
QEventPoint::QEventPoint(int pointId, QEventPoint::State state, const QPointF &scenePosition, const QPointF &globalPosition)
与えられたpointId 、state 、scenePosition 、globalPosition でイベントポイントを構築する。
[noexcept]
QEventPoint::QEventPoint(const QEventPoint &other)
other を浅くコピーしてイベントポイントを構築する。
[noexcept]
QEventPoint::QEventPoint(QEventPoint &&other)
other を移動してイベントポイントを構築する。
[noexcept]
QEventPoint::~QEventPoint()
イベントポイントを破壊する。
QPointF QEventPoint::normalizedPosition() const
この点の正規化された位置を返す。
座標は、globalPosition() をQInputDevice::availableVirtualGeometry() の空間に変換することによって計算される。つまり、(0, 0)
は左上隅、(1, 1)
は右下隅である。
globalPositionも参照 。
[noexcept]
bool QEventPoint::operator!=(const QEventPoint &other) const
このイベントポイントがother と等しくなければtrue
を返し、そうでなければfalse
を返す。
[noexcept]
QEventPoint &QEventPoint::operator=(QEventPoint &&other)
Move- このイベントポイントインスタンスにother を割り当てる。
[noexcept]
QEventPoint &QEventPoint::operator=(const QEventPoint &other)
このイベントポイントにother を割り当て、このイベントポイントへの参照を返す。
[noexcept]
bool QEventPoint::operator==(const QEventPoint &other) const
このイベントポイントがother と等しい場合はtrue
を返し、そうでない場合はfalse
を返す。
© 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.