このページでは

Q3DInputHandler Class

基本的なホイールマウス入力ハンドラ。詳細...

ヘッダー: #include <Q3DInputHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
バージョン: QtDataVisualization 1.0
QML における: InputHandler3D
継承元: QAbstract3DInputHandler
継承元:

QTouch3DInputHandler

ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

プロパティ

パブリック関数

Q3DInputHandler(QObject *parent = nullptr)
virtual ~Q3DInputHandler()
bool isRotationEnabled() const
bool isSelectionEnabled() const
bool isZoomAtTargetEnabled() const
bool isZoomEnabled() const
void setRotationEnabled(bool enable)
void setSelectionEnabled(bool enable)
void setZoomAtTargetEnabled(bool enable)
void setZoomEnabled(bool enable)

再実装されたパブリック関数

virtual void mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos) override
virtual void mousePressEvent(QMouseEvent *event, const QPoint &mousePos) override
virtual void mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos) override
virtual void wheelEvent(QWheelEvent *event) override

シグナル

void rotationEnabledChanged(bool enable)
void selectionEnabledChanged(bool enable)
void zoomAtTargetEnabledChanged(bool enable)
void zoomEnabledChanged(bool enable)

詳細な説明

Q3DInputHandler は、ホイールマウス型の入力デバイスに対する基本的な入力ハンドラです。

デフォルトの入力ハンドラには、以下の機能があります。

マウスの動作アクション
右ボタンを押したままのドラッグQ3DCamera で設定された制限範囲内でグラフを回転させます。
左クリックカーソルの下の項目を選択するか、何も選択されていない場合は選択を解除します。「selection mode 」の設定に応じて、セカンダリビューが開く場合があります。
マウスホイールQ3DCamera で設定された許容ズーム範囲内で、ズームイン/ズームアウトを行います。
セカンダリビューが表示されている状態でプライマリビューを左クリックセカンダリビューを閉じます。

注: セカンダリビューは 、Q3DBars およびQ3DSurface のグラフでのみ利用可能です。

このクラスの対応するプロパティを使用することで、回転、ズーム、および選択を個別に無効にすることができます。

プロパティのドキュメント

[since QtDataVisualization 1.2] rotationEnabled : bool

このプロパティは、この入力ハンドラがグラフの回転を許可するかどうかを示します。

デフォルト値はtrue です。

この列挙型は、QtDataVisualization 1.2で導入されました。

アクセス関数:

bool isRotationEnabled() const
void setRotationEnabled(bool enable)

Notifierシグナル:

void rotationEnabledChanged(bool enable)

[since QtDataVisualization 1.2] selectionEnabled : bool

このプロパティは、この入力ハンドラがグラフからの選択を許可するかどうかを示します。

デフォルトはtrue です。

この列挙型は、QtDataVisualization 1.2で導入されました。

アクセス関数:

bool isSelectionEnabled() const
void setSelectionEnabled(bool enable)

通知シグナル:

void selectionEnabledChanged(bool enable)

[since QtDataVisualization 1.2] zoomAtTargetEnabled : bool

このプロパティは、ズーム操作後にグラフのズーム対象点が同じ位置に留まるよう、カメラのターゲットを変更すべきかどうかを指定します。

デフォルトはtrue です。

この列挙型は、QtDataVisualization 1.2 で導入されました。

アクセス関数:

bool isZoomAtTargetEnabled() const
void setZoomAtTargetEnabled(bool enable)

Notifierシグナル:

void zoomAtTargetEnabledChanged(bool enable)

[since QtDataVisualization 1.2] zoomEnabled : bool

このプロパティは、この入力ハンドラがグラフのズームを許可するかどうかを示します。

デフォルト値はtrue です。

この列挙型は、QtDataVisualization 1.2で導入されました。

アクセス関数:

bool isZoomEnabled() const
void setZoomEnabled(bool enable)

通知シグナル:

void zoomEnabledChanged(bool enable)

メンバ関数のドキュメント

[explicit] Q3DInputHandler::Q3DInputHandler(QObject *parent = nullptr)

基本的なマウス入力ハンドラを作成します。オプションのparent パラメータを指定すると、その値がQObject のコンストラクタに渡されます。

[virtual noexcept] Q3DInputHandler::~Q3DInputHandler()

入力ハンドラを破棄します。

[override virtual] void Q3DInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos)

QAbstract3DInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos) を再実装します。

マウスの移動イベントの処理を変更するには、この関数をオーバーライドしてください。マウスの移動イベントは `event ` に、マウスの位置は `mousePos` に渡されます。

[override virtual] void Q3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos)

QAbstract3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos) を再実装します。

マウスの押下イベントの処理を変更するには、この関数をオーバーライドしてください。マウスの押下イベントは `event ` に、マウスの位置は `mousePos` に格納されています。

[override virtual] void Q3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos)

QAbstract3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos) を再実装します。

マウスのリリースイベントの処理を変更するには、この関数をオーバーライドしてください。マウスのリリースイベントは `event ` に、マウスの位置は `mousePos` に渡されます。

[override virtual] void Q3DInputHandler::wheelEvent(QWheelEvent *event)

QAbstract3DInputHandler::wheelEvent(QWheelEvent *event) を再実装します。

ホイールイベントの処理を変更するには、この関数をオーバーライドしてください。ホイールイベントはevent に渡されます。

© 2026 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.