forked from qt-creator/qt-creator
Lua: Fix "toolTip" case
Change-Id: I63922e030e4b6d8caa9ad5c0153bae333f9928e1 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -42,11 +42,11 @@ void setupActionModule()
|
||||
sol::property(
|
||||
[](ScriptCommand *cmd) { return cmd->m_contextAction->isEnabled(); },
|
||||
[](ScriptCommand *cmd, bool enabled) { cmd->m_contextAction->setEnabled(enabled); }),
|
||||
"tooltip",
|
||||
"toolTip",
|
||||
sol::property(
|
||||
[](ScriptCommand *cmd) { return cmd->m_contextAction->toolTip(); },
|
||||
[](ScriptCommand *cmd, const QString &tooltip) {
|
||||
cmd->m_contextAction->setToolTip(tooltip);
|
||||
[](ScriptCommand *cmd, const QString &toolTip) {
|
||||
cmd->m_contextAction->setToolTip(toolTip);
|
||||
}),
|
||||
"text",
|
||||
sol::property(
|
||||
|
@@ -333,11 +333,11 @@ void setupSettingsModule()
|
||||
if (data) {
|
||||
aspect->addOption(
|
||||
{option["name"],
|
||||
option["tooltip"].get_or(QString()),
|
||||
option["toolTip"].get_or(QString()),
|
||||
QVariant::fromValue(*data)});
|
||||
} else {
|
||||
aspect->addOption(
|
||||
option["name"], option["tooltip"].get_or(QString()));
|
||||
option["name"], option["toolTip"].get_or(QString()));
|
||||
}
|
||||
} else if (
|
||||
sol::optional<QString> name
|
||||
@@ -362,14 +362,14 @@ void setupSettingsModule()
|
||||
"addOption",
|
||||
sol::overload(
|
||||
[](SelectionAspect &self, const QString &name) { self.addOption(name); },
|
||||
[](SelectionAspect &self, const QString &name, const QString &tooltip) {
|
||||
self.addOption(name, tooltip);
|
||||
[](SelectionAspect &self, const QString &name, const QString &toolTip) {
|
||||
self.addOption(name, toolTip);
|
||||
},
|
||||
[](SelectionAspect &self,
|
||||
const QString &name,
|
||||
const QString &tooltip,
|
||||
const QString &toolTip,
|
||||
const sol::object &data) {
|
||||
self.addOption({name, tooltip, QVariant::fromValue(data)});
|
||||
self.addOption({name, toolTip, QVariant::fromValue(data)});
|
||||
}),
|
||||
sol::base_classes,
|
||||
sol::bases<TypedAspect<int>, BaseAspect>());
|
||||
|
@@ -19,7 +19,7 @@ action.CommandAttribute = {
|
||||
---@field text? string The text to display for the action.
|
||||
---@field icon? FilePath|string The icon to display for the action.
|
||||
---@field iconText? string The icon text to display for the action.
|
||||
---@field toolTip? string The tooltip to display for the action.
|
||||
---@field toolTip? string The toolTip to display for the action.
|
||||
---@field onTrigger? function The callback to call when the action is triggered.
|
||||
---@field commandAttributes? CommandAttributes The attributes of the action.
|
||||
---@field commandDescription? string The description of the command.
|
||||
@@ -37,7 +37,7 @@ function action.create(id, options) end
|
||||
---@class Command
|
||||
---@field enabled boolean Whether the command is enabled or not.
|
||||
---@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.
|
||||
---@field toolTip string The toolTip of the command. Make sure to specify `commandAttributes = CommandAttribute.CA_UpdateText` in the options.
|
||||
Command = {}
|
||||
|
||||
---return the module
|
||||
|
@@ -88,7 +88,7 @@ settings.SelectionDisplayStyle = {
|
||||
|
||||
---@class SelectionOption
|
||||
---@field name string The name of the option.
|
||||
---@field tooltip? string The tooltip of the option.
|
||||
---@field toolTip? string The toolTip of the option.
|
||||
---@field data? any The data of the option.
|
||||
SelectionOption = {}
|
||||
|
||||
@@ -104,7 +104,7 @@ function settings.SelectionAspect.create(options) end
|
||||
|
||||
function settings.SelectionAspect:addOption(option) end
|
||||
|
||||
function settings.SelectionAspect:addOption(option, tooltip) end
|
||||
function settings.SelectionAspect:addOption(option, toolTip) end
|
||||
settings.MultiSelectionAspect = {}
|
||||
function settings.MultiSelectionAspect.create(options) end
|
||||
|
||||
|
@@ -77,7 +77,7 @@ function TextDocument:blockAndColumn(position) end
|
||||
---@return integer blockCount The number of blocks in the document.
|
||||
function TextDocument:blockCount() end
|
||||
|
||||
---Sets the suggestions for the document and enables tooltip on the mouse cursor hover.
|
||||
---Sets the suggestions for the document and enables toolTip on the mouse cursor hover.
|
||||
---@param suggestions Suggestion[] A list of possible suggestions to display.
|
||||
function TextDocument:setSuggestions(suggestions) end
|
||||
|
||||
|
Reference in New Issue
Block a user