QMouseEvent Class

class Qt3DInput::QMouseEvent

The Qt3DCore::QMouseEvent contains parameters that describe a mouse event. More...

Header: #include <Qt3DInput/QMouseEvent>
qmake: QT += 3dinput
Since: Qt 5.5
Instantiated By: MouseEvent

This class was introduced in Qt 5.5.

Public Types

enum Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton }

Public Functions

Qt3DInput::QMouseEvent::Buttons button() const
int buttons() const
bool isAccepted() const
int modifiers() const
void setAccepted(bool accepted)
QEvent::Type type() const
int x() const
int y() const
typedef QMouseEventPtr

Detailed Description

Mouse events occur when a mouse button is pressed and the ray traversing the view, originating from the mouse position intersects with one or more elements of the scene.

See also QKeyEvent, QWheelEvent, and QMouseHandler.

Member Type Documentation

enum QMouseEvent::Buttons

ConstantValue
Qt3DInput::QMouseEvent::LeftButtonQt::LeftButton
Qt3DInput::QMouseEvent::RightButtonQt::RightButton
Qt3DInput::QMouseEvent::MiddleButtonQt::MiddleButton
Qt3DInput::QMouseEvent::BackButton5
Qt3DInput::QMouseEvent::NoButtonQt::NoButton

Member Function Documentation

Qt3DInput::QMouseEvent::Buttons QMouseEvent::button() const

Returns the mouse button of the mouse event.

int QMouseEvent::buttons() const

Returns a bitfield to be used to check for mouse buttons that may be accompanying the mouse event.

bool QMouseEvent::isAccepted() const

Returns whether the event was accepted.

int QMouseEvent::modifiers() const

Returns the keyboard modifiers that may be accompanying the mouse event.

void QMouseEvent::setAccepted(bool accepted)

Sets the event as accepted if accepted is true.

Note: When an event is accepted, it will prevent further propagation to other listeners.

See also isAccepted().

QEvent::Type QMouseEvent::type() const

Returns the QEvent::Type of the event.

int QMouseEvent::x() const

Returns the x position of the mouse event.

int QMouseEvent::y() const

Returns the y position of the mouse event.

Related Non-Members

typedef QMouseEventPtr

A shared pointer for QMouseEvent.