IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Q3DInputHandler Class

Basic wheel mouse based input handler.

This class was introduced in QtDataVisualization 1.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Q3DInputHandler Class

  • Header: Q3DInputHandler

  • Since: QtDataVisualization 1.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS DataVisualization)

    target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)

  • qmake: QT += datavisualization

  • Inherited By: QTouch3DInputHandler

  • Instantiated By: qml-qtdatavisualization-inputhandler3d.xml

  • Inherits: QAbstract3DInputHandler

  • Inherited By: QTouch3DInputHandler

Detailed Description

Q3DInputHandler is the basic input handler for wheel mouse type of input devices.

Default input handler has the following functionalty:

Mouse action

Action

Drag with right button pressed

Rotate graph within limits set for Q3DCamera.

Left click

Select item under cursor or remove selection if none. May open the secondary view depending on the selection mode.

Mouse wheel

Zoom in/out within the allowable zoom range set for Q3DCamera.

Left click on the primary view when the secondary view is visible

Closes the secondary view.

Secondary view is available only for Q3DBars and Q3DSurface graphs.

Rotation, zoom, and selection can each be individually disabled using corresponding properties of this class.

Property Documentation

 

[since QtDataVisualization 1.2] rotationEnabled : bool

This property holds whether this input handler allows graph rotation.

Defaults to true.

This property was introduced in QtDataVisualization 1.2.

Access functions:

  • bool isRotationEnabled() const

  • void setRotationEnabled(bool enable)

Notifier signal:

  • void rotationEnabledChanged(bool enable)

[since QtDataVisualization 1.2] selectionEnabled : bool

This property holds whether this input handler allows selection from the graph.

Defaults to true.

This property was introduced in QtDataVisualization 1.2.

Access functions:

  • bool isSelectionEnabled() const

  • void setSelectionEnabled(bool enable)

Notifier signal:

  • void selectionEnabledChanged(bool enable)

[since QtDataVisualization 1.2] zoomAtTargetEnabled : bool

This property holds whether zooming should change the camera target so that the zoomed point of the graph stays at the same location after the zoom.

Defaults to true.

This property was introduced in QtDataVisualization 1.2.

Access functions:

  • bool isZoomAtTargetEnabled() const

  • void setZoomAtTargetEnabled(bool enable)

Notifier signal:

  • void zoomAtTargetEnabledChanged(bool enable)

[since QtDataVisualization 1.2] zoomEnabled : bool

This property holds whether this input handler allows graph zooming.

Defaults to true.

This property was introduced in QtDataVisualization 1.2.

Access functions:

  • bool isZoomEnabled() const

  • void setZoomEnabled(bool enable)

Notifier signal:

  • void zoomEnabledChanged(bool enable)

Member Function Documentation

 

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

Constructs the basic mouse input handler. An optional parent parameter can be given and is then passed to QObject constructor.

[virtual] Q3DInputHandler::~Q3DInputHandler()

Destroys the input handler.

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

Reimplements: QAbstract3DInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos).

Override this to change handling of mouse move events. Mouse move event is given in the event and the mouse position in mousePos.

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

Reimplements: QAbstract3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos).

Override this to change handling of mouse press events. Mouse press event is given in the event and the mouse position in mousePos.

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

Reimplements: QAbstract3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos).

Override this to change handling of mouse release events. Mouse release event is given in the event and the mouse position in mousePos.

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

Reimplements: QAbstract3DInputHandler::wheelEvent(QWheelEvent *event).

Override this to change handling of wheel events. The wheel event is given in the event.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+