Lua: Add FilePathAspect.defaultPath

Change-Id: Idb53db75f12960425a8ebec3fd047137b7a8207e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-04-18 13:45:14 +02:00
parent bdada3c5ff
commit aef6e9b87b
2 changed files with 6 additions and 0 deletions

View File

@@ -299,6 +299,11 @@ void addSettingsModule()
auto filePathAspectType = addTypedAspect<FilePathAspect>(settings, "FilePathAspect"); auto filePathAspectType = addTypedAspect<FilePathAspect>(settings, "FilePathAspect");
filePathAspectType.set("expandedValue", sol::property(&FilePathAspect::expandedValue)); filePathAspectType.set("expandedValue", sol::property(&FilePathAspect::expandedValue));
filePathAspectType.set(
"defaultPath",
sol::property(
[](FilePathAspect &self) { return FilePath::fromUserInput(self.defaultValue()); },
&FilePathAspect::setDefaultPathValue));
addTypedAspect<IntegerAspect>(settings, "IntegerAspect"); addTypedAspect<IntegerAspect>(settings, "IntegerAspect");
addTypedAspect<DoubleAspect>(settings, "DoubleAspect"); addTypedAspect<DoubleAspect>(settings, "DoubleAspect");

View File

@@ -137,6 +137,7 @@ FilePathAspectCreate = {}
---@class FilePathAspect ---@class FilePathAspect
---@field expandedValue FilePath The expanded value of the aspect ---@field expandedValue FilePath The expanded value of the aspect
---@field defaultPath FilePath The default path of the aspect
settings.FilePathAspect = {} settings.FilePathAspect = {}
---Create a new FilePathAspect ---Create a new FilePathAspect