QMouseEvent Class | Qt 3D 5.6

Qt 5.6 | Qt 3D | C++ Classes | QMouseEvent

Qt 5.6.2 Reference Documentation

# QMouseEvent Class

(Qt3DInput::QMouseEvent)

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

Header: | #include <QMouseEvent>
qmake: | QT += 3dinput
Since: | Qt 5.5
Instantiated By: | MouseEvent
Inherits: | QObject

- List of all members, including inherited members

## Public Types

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

## Properties

accepted : bool button : const Qt3DInput::QMouseEvent::Buttons buttons : const int modifier : const Qt3DInput::QMouseEvent::Modifiers | wasHeld : const bool x : const int y : const int

- 1 property inherited from QObject

## Public Functions

| QMouseEvent(const QMouseEvent &e)
| ~QMouseEvent()
Buttons | button() const
int | buttons() const
bool | isAccepted() const
Modifiers | modifier() const
void | setAccepted(bool accepted)
QEvent::Type | type() const
bool | wasHeld() const
int | x() const
int | y() const

- 31 public functions inherited from QObject

### Additional Inherited Members

- 1 public slot inherited from QObject
- 2 signals inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 2 protected variables 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 QMouseInput.

## Member Type Documentation

### enum QMouseEvent::Buttons

### enum QMouseEvent::Modifiers

## Property Documentation

### accepted : bool

Access functions:

bool | isAccepted() const
void | setAccepted(bool accepted)

### button : const Qt3DInput::QMouseEvent::Buttons

Access functions:

Buttons | button() const

### buttons : const int

Access functions:

int | buttons() const

### modifier : const Qt3DInput::QMouseEvent::Modifiers

Access functions:

Modifiers | modifier() const

### wasHeld : const bool

Access functions:

bool | wasHeld() const

### x : const int

Access functions:

int | x() const

### y : const int

Access functions:

int | y() const

## Member Function Documentation

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

Constructs a new QMouseEvent instance for the QMouseEvent e.

### QMouseEvent::~QMouseEvent()

Destroys the instance of 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.

### Modifiers QMouseEvent::modifier() const

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

Note: Getter function for property modifier.

### 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.