The QKeyEventTransition class provides a transition for key events. 更多...
头: | #include <QKeyEventTransition> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS StateMachine)
target_link_libraries(mytarget PRIVATE Qt6::StateMachine) |
qmake: | QT += statemachine |
继承: | QEventTransition |
QKeyEventTransition (QState * sourceState = nullptr) | |
QKeyEventTransition (QObject * object , QEvent::Type type , int key , QState * sourceState = nullptr) | |
virtual | ~QKeyEventTransition () |
QBindable<int> | bindableKey () |
QBindable<Qt::KeyboardModifiers> | bindableModifierMask () |
int | key () const |
Qt::KeyboardModifiers | modifierMask () const |
void | setKey (int key ) |
void | setModifierMask (Qt::KeyboardModifiers modifierMask ) |
virtual bool | eventTest (QEvent * event ) override |
virtual void | onTransition (QEvent * event ) override |
QKeyEventTransition is part of Qt State Machine Framework .
另请参阅 QState::addTransition ().
[bindable]
key
:
int
注意: 此特性支持 QProperty 绑定。
This property holds the key that this key event transition is associated with
[bindable]
modifierMask
:
Qt::KeyboardModifiers
注意: 此特性支持 QProperty 绑定。
This property holds the keyboard modifier mask that this key event transition checks for
Constructs a new key event transition with the given sourceState .
Constructs a new key event transition for events of the given type 为给定 object ,采用给定 key and sourceState .
[虚拟]
QKeyEventTransition::
~QKeyEventTransition
()
Destroys this key event transition.
[override virtual protected]
bool
QKeyEventTransition::
eventTest
(
QEvent
*
event
)
重实现: QEventTransition::eventTest (QEvent *event).
Returns the key that this key event transition checks for.
注意: Getter function for property key.
另请参阅 setKey ().
Returns the keyboard modifier mask that this key event transition checks for.
注意: Getter function for property modifierMask.
另请参阅 setModifierMask ().
[override virtual protected]
void
QKeyEventTransition::
onTransition
(
QEvent
*
event
)
重实现: QEventTransition::onTransition (QEvent *event).
设置 key that this key event transition will check for.
注意: setter 函数对于特性 key .
另请参阅 key ().
Sets the keyboard modifier mask that this key event transition will check for to modifierMask .
注意: setter 函数对于特性 modifierMask .
另请参阅 modifierMask ().