Lua: Add access for plugin application data path

Change-Id: Ib5f60818b8b2590d3a5d09a7900110956f98b4cf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Justyna Hudziak
2024-09-27 14:54:24 +02:00
parent 47a0f935ba
commit c70e7d76f5
2 changed files with 4 additions and 1 deletions

View File

@@ -72,7 +72,9 @@ QObject *ScriptPluginSpec::setup(
"name", "name",
sol::property([](ScriptPluginSpec &self) { return self.name; }), sol::property([](ScriptPluginSpec &self) { return self.name; }),
"pluginDirectory", "pluginDirectory",
sol::property([pluginLocation]() { return pluginLocation; })); sol::property([pluginLocation]() { return pluginLocation; }),
"appDataPath",
sol::property([appDataPath]() { return appDataPath; }));
auto guardObject = std::make_unique<QObject>(); auto guardObject = std::make_unique<QObject>();
auto guardObjectPtr = guardObject.get(); auto guardObjectPtr = guardObject.get();

View File

@@ -3,6 +3,7 @@
---@class PluginSpec ---@class PluginSpec
---@field name string The name of the plugin. ---@field name string The name of the plugin.
---@field pluginDirectory FilePath The directory of the plugin. ---@field pluginDirectory FilePath The directory of the plugin.
---@field appDataPath FilePath The application data directory of the plugin.
PluginSpec = {} PluginSpec = {}
---The global qtc object defined in the Lua plugin. ---The global qtc object defined in the Lua plugin.
---@class qtc ---@class qtc