QShortcutEvent 類

QShortcutEvent 類提供當用戶按下組閤鍵時生成的事件。 更多...

頭: #include <QShortcutEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
繼承: QEvent

公共函數

QShortcutEvent (const QKeySequence & key , const QShortcut * shortcut = nullptr, bool ambiguous = false)
bool isAmbiguous () const
const QKeySequence & key () const

詳細描述

通常,不需要直接使用此類; QShortcut 提供處理快捷鍵的更高級彆接口。

另請參閱 QShortcut .

成員函數文檔編製

[since 6.5] QShortcutEvent:: QShortcutEvent (const QKeySequence & key , const QShortcut * shortcut = nullptr, bool ambiguous = false)

構造快捷鍵事件為給定 key 按下,關聯 QShortcut shortcut .

ambiguous specifies whether there is more than one QShortcut for the same key sequence.

This function was introduced in Qt 6.5.

bool QShortcutEvent:: isAmbiguous () const

返迴 true if the key sequence that triggered the event is ambiguous.

另請參閱 QShortcut::activatedAmbiguously ().

const QKeySequence &QShortcutEvent:: key () const

Returns the key sequence that triggered the event.