QMouseEvent 类

( Qt3DInput::QMouseEvent )

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

头: #include <Qt3DInput/QMouseEvent>
qmake: QT += 3dinput
Since: Qt 5.5
实例化: MouseEvent
继承: QObject

公共类型

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

特性

公共函数

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
typedef QMouseEventPtr

额外继承成员

详细描述

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 ,和 QMouseHandler .

成员类型文档编制

enum QMouseEvent:: Buttons

常量
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

常量
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

指定若鼠标事件已被接受

访问函数:

bool isAccepted () const
void setAccepted (bool accepted )

button : const Qt3DInput::QMouseEvent::Buttons

指定触发鼠标事件的按钮

访问函数:

Buttons button () const

buttons : const int

指定触发鼠标事件的按钮

访问函数:

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 )

构造新的 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.

注意: Getter 函数对于特性 button .

int QMouseEvent:: buttons () const

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

注意: Getter 函数对于特性 buttons .

bool QMouseEvent:: isAccepted () const

Returns whether the event was accepted.

注意: Getter 函数对于特性 accepted .

Modifiers QMouseEvent:: modifiers () const

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

注意: Getter 函数对于特性 modifiers .

void QMouseEvent:: setAccepted ( bool accepted )

Sets the event as accepted if accepted 为 true。

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

注意: Setter 函数对于特性 accepted .

另请参阅 isAccepted ().

QEvent::Type QMouseEvent:: type () const

返回 QEvent::Type of the event.

int QMouseEvent:: x () const

Returns the x position of the mouse event.

注意: Getter 函数对于特性 x .

int QMouseEvent:: y () const

Returns the y position of the mouse event.

注意: Getter 函数对于特性 y .

相关非成员

typedef Qt3DInput:: QMouseEventPtr

共享指针为 QMouseEvent .