QMouseEvent Class▲
-
Header: Qt3DInput/QMouseEvent
-
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-mouseevent.xml
-
Inherits: QObject
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▲
See also QKeyEvent, QWheelEvent, QMouseHandler
Member Type Documentation▲
enum QMouseEvent::Buttons▲
Constant |
|
---|---|
Qt3DInput::QMouseEvent::LeftButton |
Qt::LeftButton |
Qt3DInput::QMouseEvent::RightButton |
Qt::RightButton |
Qt3DInput::QMouseEvent::MiddleButton |
Qt::MiddleButton |
Qt3DInput::QMouseEvent::BackButton |
Qt::BackButton |
Qt3DInput::QMouseEvent::NoButton |
Qt::NoButton |
enum QMouseEvent::Modifiers▲
Constant |
|
---|---|
Qt3DInput::QMouseEvent::NoModifier |
Qt::NoModifier |
Qt3DInput::QMouseEvent::ShiftModifier |
Qt::ShiftModifier |
Qt3DInput::QMouseEvent::ControlModifier |
Qt::ControlModifier |
Qt3DInput::QMouseEvent::AltModifier |
Qt::AltModifier |
Qt3DInput::QMouseEvent::MetaModifier |
Qt::MetaModifier |
Qt3DInput::QMouseEvent::KeypadModifier |
Qt::KeypadModifier |
Property Documentation▲
accepted : bool▲
Specifies if the mouse event has been accepted
Access functions:
-
bool isAccepted() const
-
void setAccepted(bool accepted)
[read-only] button : const Qt3DInput::QMouseEvent::Buttons▲
Access functions:
-
button() const
[read-only] buttons : const int▲
Access functions:
-
int buttons() const
[read-only] modifiers : const Qt3DInput::QMouseEvent::Modifiers▲
[read-only] wasHeld : const bool▲
Specifies if a mouse button was held down during the mouse event
Access functions:
-
bool wasHeld() const
[read-only] x : const int▲
[read-only] y : const int▲
Member Function Documentation▲
[explicit] QMouseEvent::QMouseEvent(const ::QMouseEvent &e)▲
Constructs a new QMouseEvent instance for the QMouseEvent e.
Qt3DInput::QMouseEvent::Buttons QMouseEvent::button() const▲
Getter function for property button.
int QMouseEvent::buttons() const▲
Getter function for property buttons.
bool QMouseEvent::isAccepted() const▲
Returns whether the event was accepted.
Getter function for property accepted.
Qt3DInput::QMouseEvent::Modifiers QMouseEvent::modifiers() const▲
Returns the keyboard modifiers that may be accompanying the mouse event.
Getter function for property modifiers.
void QMouseEvent::setAccepted(bool accepted)▲
Sets the event as accepted if accepted is true.
When an event is accepted, it will prevent further propagation to other listeners.
Setter function for property accepted.
See Also▲
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.
Getter function for property x.
int QMouseEvent::y() const▲
Returns the y position of the mouse event.
Getter function for property y.