QMouseEvent 類

class Qt3DInput ::QMouseEvent

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

頭: #include <Qt3DInput/QMouseEvent>
qmake: QT += 3dinput
Since: Qt 5.5
實例化: MouseEvent
繼承: QObject

該類在 Qt 5.5 引入。

公共類型

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

特性

公共函數

QMouseEvent (const ::QMouseEvent & e )
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
typedef QMouseEventPtr

詳細描述

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

指定觸發鼠標事件的按鈕

訪問函數:

Qt3DInput::QMouseEvent::Buttons button () const

buttons : const int

指定觸發鼠標事件的按鈕

訪問函數:

int buttons () const

modifiers : const Qt3DInput::QMouseEvent::Modifiers

Specifies if any modifiers were applied to the mouse event

訪問函數:

Qt3DInput::QMouseEvent::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 .

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

Returns the mouse button of the mouse event.

注意: 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.

注意: Getter function for property buttons.

bool QMouseEvent:: isAccepted () const

Returns whether the event was accepted.

注意: getter 函數對於特性 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 為 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 function for property x.

int QMouseEvent:: y () const

Returns the y position of the mouse event.

注意: Getter function for property y.

相關非成員

typedef QMouseEventPtr

共享指針為 QMouseEvent .