Provides a means of being notified about mouse events when attached to a QMouseDevice 实例。 更多...
头: | #include <Qt3DInput/QMouseHandler> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput) |
qmake: | QT += 3dinput |
实例化: | MouseHandler |
继承: | Qt3DCore::QComponent |
QMouseHandler (Qt3DCore::QNode * parent = nullptr) | |
bool | containsMouse () const |
Qt3DInput::QMouseDevice * | sourceDevice () const |
void | setSourceDevice (Qt3DInput::QMouseDevice * mouseDevice ) |
void | clicked (Qt3DInput::QMouseEvent * mouse ) |
void | containsMouseChanged (bool containsMouse ) |
void | doubleClicked (Qt3DInput::QMouseEvent * mouse ) |
void | entered () |
void | exited () |
void | positionChanged (Qt3DInput::QMouseEvent * mouse ) |
void | pressAndHold (Qt3DInput::QMouseEvent * mouse ) |
void | pressed (Qt3DInput::QMouseEvent * mouse ) |
void | released (Qt3DInput::QMouseEvent * mouse ) |
void | sourceDeviceChanged (Qt3DInput::QMouseDevice * mouseDevice ) |
void | wheel (Qt3DInput::QWheelEvent * wheel ) |
注意: QMouseHandler components shouldn't be shared, not respecting that condition will most likely result in undefined behaviors.
另请参阅 QMouseDevice and QMouseEvent .
[read-only]
containsMouse
: const
bool
保持
true
若
QMouseHandler
currently contains the mouse.
注意: In this context, contains mean that the ray originating from the mouse is intersecting with the Qt3DCore::QEntity that aggregates the current QMouseHandler instance component.
访问函数:
bool | containsMouse () const |
通知程序信号:
void | containsMouseChanged (bool containsMouse ) |
Holds the current mouse source device of the QMouseHandler 实例。
访问函数:
Qt3DInput::QMouseDevice * | sourceDevice () const |
void | setSourceDevice (Qt3DInput::QMouseDevice * mouseDevice ) |
通知程序信号:
void | sourceDeviceChanged (Qt3DInput::QMouseDevice * mouseDevice ) |
[explicit]
QMouseHandler::
QMouseHandler
(
Qt3DCore::QNode
*
parent
= nullptr)
Constructs a new QMouseHandler instance with parent parent .
[signal]
void
QMouseHandler::
clicked
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when a mouse button is clicked with the event details being contained within mouse .
[signal]
void
QMouseHandler::
doubleClicked
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when a mouse button is double clicked with the event details being contained within mouse .
[signal]
void
QMouseHandler::
entered
()
[signal]
void
QMouseHandler::
exited
()
[signal]
void
QMouseHandler::
positionChanged
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when the mouse position changes with the event details being contained within mouse
[signal]
void
QMouseHandler::
pressAndHold
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when a mouse button is pressed and held down with the event details being contained within mouse
[signal]
void
QMouseHandler::
pressed
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when a mouse button is pressed with the event details being contained within mouse
[signal]
void
QMouseHandler::
released
(
Qt3DInput::QMouseEvent
*
mouse
)
This signal is emitted when a mouse button is released with the event details being contained within mouse
[slot]
void
QMouseHandler::
setSourceDevice
(
Qt3DInput::QMouseDevice
*
mouseDevice
)
Sets the mouse device of the QMouseHandler instance to mouseDevice .
注意: setter 函数对于特性 sourceDevice .
另请参阅 sourceDevice ().
[signal]
void
QMouseHandler::
wheel
(
Qt3DInput::QWheelEvent
*
wheel
)
This signal is emitted when the mouse wheel is used with the event details being contained within wheel