diff --git a/src/plugins/lua/bindings/settings.cpp b/src/plugins/lua/bindings/settings.cpp index a023cd5a557..241b1970c63 100644 --- a/src/plugins/lua/bindings/settings.cpp +++ b/src/plugins/lua/bindings/settings.cpp @@ -300,6 +300,13 @@ void addSettingsModule() addTypedAspect(settings, "StringAspect"); auto filePathAspectType = addTypedAspect(settings, "FilePathAspect"); + filePathAspectType.set( + "setValue", + sol::overload( + [](FilePathAspect &self, const QString &value) { + self.setValue(FilePath::fromUserInput(value)); + }, + [](FilePathAspect &self, const FilePath &value) { self.setValue(value); })); filePathAspectType.set("expandedValue", sol::property(&FilePathAspect::expandedValue)); filePathAspectType.set( "defaultPath", diff --git a/src/plugins/lua/meta/settings.lua b/src/plugins/lua/meta/settings.lua index 2c947f42502..09af050d924 100644 --- a/src/plugins/lua/meta/settings.lua +++ b/src/plugins/lua/meta/settings.lua @@ -145,6 +145,10 @@ settings.FilePathAspect = {} ---@return FilePathAspect function settings.FilePathAspect.create(options) end +---Set the value of the aspect +---@param value string|FilePath The value to set +function settings.FilePathAspect:setValue(value) end + settings.IntegerAspect = {} function settings.IntegerAspect.create(options) end