forked from qt-creator/qt-creator
Lua: Expose property keySequences for ScriptCommand
Change-Id: If29893fdcdbe4e1a07ccad6353d42c3e33dcb198 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -42,6 +42,10 @@ void setupActionModule()
|
||||
sol::property(
|
||||
[](ScriptCommand *cmd) { return cmd->m_contextAction->isEnabled(); },
|
||||
[](ScriptCommand *cmd, bool enabled) { cmd->m_contextAction->setEnabled(enabled); }),
|
||||
"keySequences",
|
||||
sol::property([](ScriptCommand* cmd) -> QList<QKeySequence> {
|
||||
return cmd->m_cmd->keySequences();
|
||||
}),
|
||||
"toolTip",
|
||||
sol::property(
|
||||
[](ScriptCommand *cmd) { return cmd->m_contextAction->toolTip(); },
|
||||
|
@@ -42,6 +42,7 @@ function action.trigger(id) end
|
||||
|
||||
---@class Command
|
||||
---@field enabled boolean Whether the command is enabled or not.
|
||||
---@field keySequences QKeySequence[] Current key sequences for the command.
|
||||
---@field text string The text of the command. Make sure to specify `commandAttributes = CommandAttribute.CA_UpdateText` in the options.
|
||||
---@field toolTip string The toolTip of the command. Make sure to specify `commandAttributes = CommandAttribute.CA_UpdateText` in the options.
|
||||
Command = {}
|
||||
|
Reference in New Issue
Block a user