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

QMouseHandler Class

Provides a means of being notified about mouse events when attached to a QMouseDevice instance.

This class was introduced in Qt 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QMouseHandler Class

  • Header: Qt3DInput/QMouseHandler

  • Since: Qt 5.5

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS 3dinput)

    target_link_libraries(mytarget PRIVATE Qt6::3dinput)

  • qmake: QT += 3dinput

  • Inherited By:

  • Instantiated By: qml-qt3d-input-mousehandler.xml

  • Inherits: Qt3DCore::QComponent

Detailed Description

QMouseHandler components shouldn't be shared, not respecting that condition will most likely result in undefined behaviors.

See Also

Property Documentation

 

[read-only] containsMouse : const bool

Holds true if the QMouseHandler currently contains the mouse.

In this context, contains mean that the ray originating from the mouse is intersecting with the Qt3DCore::QEntity that aggregates the current QMouseHandler instance component.

Access functions:

  • bool containsMouse() const

Notifier signal:

  • void containsMouseChanged(bool containsMouse)

sourceDevice : Qt3DInput::QMouseDevice*

Holds the current mouse source device of the QMouseHandler instance.

Access functions:

Notifier signal:

  • void sourceDeviceChanged( *mouseDevice)

Member Function Documentation

 

[explicit] QMouseHandler::QMouseHandler(Qt3DCore::QNode *parent = nullptr)

Constructs a new QMouseHandler instance with parent parent.

void QMouseHandler::clicked(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is clicked with the event details being contained within mouse.

void QMouseHandler::doubleClicked(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is double clicked with the event details being contained within mouse.

void QMouseHandler::entered()

 

void QMouseHandler::exited()

 

void QMouseHandler::positionChanged(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when the mouse position changes with the event details being contained within mouse

void QMouseHandler::pressAndHold(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is pressed and held down with the event details being contained within mouse

void QMouseHandler::pressed(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is pressed with the event details being contained within mouse

void QMouseHandler::released(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is released with the event details being contained within mouse

void QMouseHandler::setSourceDevice(Qt3DInput::QMouseDevice *mouseDevice)

Sets the mouse device of the QMouseHandler instance to mouseDevice.

Setter function for property sourceDevice.

See Also

See also sourceDevice()

void QMouseHandler::wheel(Qt3DInput::QWheelEvent *wheel)

This signal is emitted when the mouse wheel is used with the event details being contained within wheel

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