Lua: Add binding for FilePathAspect::setValue

Change-Id: Ia0c40f35c1504b72f56cb2d2b6dcdc721b1c9d7b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-05-30 12:53:19 +02:00
parent 42a66746e1
commit 1c6ea674d7
2 changed files with 11 additions and 0 deletions

View File

@@ -300,6 +300,13 @@ void addSettingsModule()
addTypedAspect<StringAspect>(settings, "StringAspect"); addTypedAspect<StringAspect>(settings, "StringAspect");
auto filePathAspectType = addTypedAspect<FilePathAspect>(settings, "FilePathAspect"); auto filePathAspectType = addTypedAspect<FilePathAspect>(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("expandedValue", sol::property(&FilePathAspect::expandedValue));
filePathAspectType.set( filePathAspectType.set(
"defaultPath", "defaultPath",

View File

@@ -145,6 +145,10 @@ settings.FilePathAspect = {}
---@return FilePathAspect ---@return FilePathAspect
function settings.FilePathAspect.create(options) end 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 = {} settings.IntegerAspect = {}
function settings.IntegerAspect.create(options) end function settings.IntegerAspect.create(options) end