Lua: Add support for Layouting::Label

Change-Id: Id06f082262af1aed4e22d40790ad3ed6ba2b5dd9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2024-05-28 14:34:50 +02:00
parent 01040420a7
commit ad2b0954d3
2 changed files with 17 additions and 0 deletions

View File

@@ -234,6 +234,15 @@ void addLayoutModule()
sol::base_classes,
sol::bases<Widget, Object, Thing>());
layout.new_usertype<Label>(
"Label",
sol::call_constructor,
sol::factories([guard](const sol::table &children) {
return constructWidgetType<Label>(children, guard);
}),
sol::base_classes,
sol::bases<Widget, Object, Thing>());
layout.new_usertype<Widget>(
"Widget",
sol::call_constructor,

View File

@@ -97,6 +97,14 @@ local pushButton = {}
---@return PushButton
function layout.PushButton(children) end
---A Label
---@class Label : LayoutItem
local label = {}
---@param children LayoutItem|string|BaseAspect|function
---@return Label
function layout.Label(children) end
---A SpinBox
---@class SpinBox : LayoutItem
local spinBox = {}