Lua: Expose Widget.toolTip property

Change-Id: I85217a568ad2f2d4038d6dff46c83707ba580d0e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Lukasz Papierkowski
2025-06-18 16:59:22 +02:00
committed by lie
parent 5551d1a8b9
commit 9ebc0f892a
2 changed files with 5 additions and 0 deletions

View File

@@ -676,6 +676,8 @@ void setupGuiModule()
sol::property([](Widget *self) { return self->emerge()->hasFocus(); }),
"setFocus",
[](Widget *self) { self->emerge()->setFocus(); },
"toolTip",
sol::property(&Widget::setToolTip),
sol::base_classes,
sol::bases<Object, Thing>());

View File

@@ -13,6 +13,8 @@ gui.layout = {}
---@class Widget : Object
---@field visible boolean Whether the widget is visible or not.
---@field enabled boolean Whether the widget is enabled or not.
---@field focus boolean Whether the widget has focus or not.
---@field toolTip string The tooltip of the widget.
gui.widget = {}
---@alias LayoutChild string|BaseAspect|Layout|Widget|function
@@ -26,6 +28,7 @@ gui.widget = {}
---@field widgetAttributes? WidgetAttributeMapT<boolean> The widget attributes of the widget.
---@field autoFillBackground? boolean A boolean, representing whether the widget should automatically fill its background.
---@field sizePolicy? SizePolicy.Policy[] Two size policies of the widget, horizontal and vertical.
---@field toolTip string The tooltip of the widget.
gui.baseWidgetOptions = {}
---@class (exact) WidgetOptions : BaseWidgetOptions