QMouseEvent 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
Inherits: QObject

Public Types

enum Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton }
enum Modifiers { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier }

Properties

  • wasHeld : const bool
  • x : const int
  • y : const int
  • 1 property inherited from QObject

Public Functions

QMouseEvent(const ::QMouseEvent &e)
virtual ~QMouseEvent()
Qt3DInput::QMouseEvent::Buttons button() const
int buttons() const
bool isAccepted() const
Qt3DInput::QMouseEvent::Modifiers modifiers() const
void setAccepted(bool accepted)
QEvent::Type type() const
bool wasHeld() const
int x() const
int y() const
  • 31 public functions inherited from QObject

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject
typedef QMouseEventPtr

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 2 signals inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

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

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::BackButtonQt::BackButton
Qt3DInput::QMouseEvent::NoButtonQt::NoButton

enum QMouseEvent::Modifiers

ConstantValue
Qt3DInput::QMouseEvent::NoModifierQt::NoModifier
Qt3DInput::QMouseEvent::ShiftModifierQt::ShiftModifier
Qt3DInput::QMouseEvent::ControlModifierQt::ControlModifier
Qt3DInput::QMouseEvent::AltModifierQt::AltModifier
Qt3DInput::QMouseEvent::MetaModifierQt::MetaModifier
Qt3DInput::QMouseEvent::KeypadModifierQt::KeypadModifier

Property Documentation

accepted : bool

Specifies if the mouse event has been accepted

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)

button : const Qt3DInput::QMouseEvent::Buttons

Specifies the button triggering the mouse event

Access functions:

Qt3DInput::QMouseEvent::Buttons button() const

buttons : const int

Specifies the button triggering the mouse event

Access functions:

int buttons() const

modifiers : const Qt3DInput::QMouseEvent::Modifiers

Specifies if any modifiers were applied to the mouse event

Access functions:

Qt3DInput::QMouseEvent::Modifiers modifiers() const

wasHeld : const bool

Specifies if a mouse button was held down during the mouse event

Access functions:

bool wasHeld() const

x : const int

Specifies The X coordinate of the mouse event

Access functions:

int x() const

y : const int

Specifies The y coordinate of the mouse event

Access functions:

int y() const

Member Function Documentation

QMouseEvent::QMouseEvent(const ::QMouseEvent &e)

Constructs a new QMouseEvent instance for the QMouseEvent e.

[virtual] QMouseEvent::~QMouseEvent()

Destroys the instance of QMouseEvent. The destructor is virtual.

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

Returns the mouse button of the mouse event.

Note: Getter function for property button.

int QMouseEvent::buttons() const

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

Note: Getter function for property buttons.

bool QMouseEvent::isAccepted() const

Returns whether the event was accepted.

Note: Getter function for property accepted.

Qt3DInput::QMouseEvent::Modifiers QMouseEvent::modifiers() const

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

Note: Getter function for property modifiers.

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.

Note: Setter function for property accepted.

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.

Note: Getter function for property x.

int QMouseEvent::y() const

Returns the y position of the mouse event.

Note: Getter function for property y.

Related Non-Members

typedef Qt3DInput::QMouseEventPtr

A shared pointer for QMouseEvent.

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