diff options
author | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2024-04-18 13:45:14 +0200 |
---|---|---|
committer | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2024-04-19 13:53:43 +0000 |
commit | aef6e9b87b685da932bf7037613685d3483f21fc (patch) | |
tree | a6b94f78fa1b1163171ace4853a6006cbfd7a6f5 | |
parent | bdada3c5ff6c4d5b22689501d27eff34173a57fc (diff) |
Lua: Add FilePathAspect.defaultPath
Change-Id: Idb53db75f12960425a8ebec3fd047137b7a8207e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/lua/bindings/settings.cpp | 5 | ||||
-rw-r--r-- | src/plugins/lua/meta/settings.lua | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/lua/bindings/settings.cpp b/src/plugins/lua/bindings/settings.cpp index d0234def04..9097987840 100644 --- a/src/plugins/lua/bindings/settings.cpp +++ b/src/plugins/lua/bindings/settings.cpp @@ -299,6 +299,11 @@ void addSettingsModule() auto filePathAspectType = addTypedAspect<FilePathAspect>(settings, "FilePathAspect"); 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<DoubleAspect>(settings, "DoubleAspect"); diff --git a/src/plugins/lua/meta/settings.lua b/src/plugins/lua/meta/settings.lua index cd06bdc903..2c947f4250 100644 --- a/src/plugins/lua/meta/settings.lua +++ b/src/plugins/lua/meta/settings.lua @@ -137,6 +137,7 @@ FilePathAspectCreate = {} ---@class FilePathAspect ---@field expandedValue FilePath The expanded value of the aspect +---@field defaultPath FilePath The default path of the aspect settings.FilePathAspect = {} ---Create a new FilePathAspect |