QMouseEvent Class
(Qt3DInput::QMouseEvent)The Qt3DCore::QMouseEvent contains parameters that describe a mouse event. 更多...
头文件: | #include <Qt3DInput/QMouseEvent> |
qmake: | QT += 3dinput |
开始支持版本: | Qt 5.5 |
Instantiated By: | MouseEvent |
基类: | QObject |
公有类型
enum | Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton } |
enum | Modifiers { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier } |
属性
- 1 个属性继承自 QObject
公有函数
QMouseEvent(const QMouseEvent &e) | |
~QMouseEvent() | |
Buttons | button() const |
int | buttons() const |
bool | isAccepted() const |
Modifiers | modifiers() const |
void | setAccepted(bool accepted) |
QEvent::Type | type() const |
bool | wasHeld() const |
int | x() const |
int | y() const |
- 32 个公有函数继承自 QObject
相关非成员
typedef | QMouseEventPtr |
其他继承的成员
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
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.
参见 QKeyEvent, QWheelEvent, and QMouseHandler.
成员类型
enum QMouseEvent::Buttons
Constant | Value |
---|---|
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 | Value |
---|---|
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 |
属性
accepted : bool
Specifies if the mouse event has been accepted
访问函数:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
button : const Qt3DInput::QMouseEvent::Buttons
Specifies the button triggering the mouse event
访问函数:
Buttons | button() const |
buttons : const int
Specifies the button triggering the mouse event
访问函数:
int | buttons() const |
modifiers : const Qt3DInput::QMouseEvent::Modifiers
Specifies if any modifiers were applied to the mouse event
访问函数:
Modifiers | modifiers() const |
wasHeld : const bool
Specifies if a mouse button was held down during the mouse event
访问函数:
bool | wasHeld() const |
x : const int
Specifies The X coordinate of the mouse event
访问函数:
int | x() const |
y : const int
Specifies The y coordinate of the mouse event
访问函数:
int | y() const |
成员函数
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::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.
参见 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.