LUA: Add Widget close() method to Gui bindings

Change-Id: I48d32c2fc9c65010be1bb7a340faebedc4ce3f4a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Lukasz Papierkowski
2024-08-21 21:09:09 +02:00
committed by lie
parent f15f048ee9
commit 3e72f59396
4 changed files with 11 additions and 0 deletions

View File

@@ -746,6 +746,11 @@ void Widget::activateWindow()
access(this)->activateWindow(); access(this)->activateWindow();
} }
void Widget::close()
{
access(this)->close();
}
QWidget *Widget::emerge() const QWidget *Widget::emerge() const
{ {
return access(this); return access(this);

View File

@@ -230,6 +230,7 @@ public:
void setNormalMargins(int = 0); void setNormalMargins(int = 0);
void setContentsMargins(int left, int top, int right, int bottom); void setContentsMargins(int left, int top, int right, int bottom);
void activateWindow(); void activateWindow();
void close();
}; };
class QTCREATOR_UTILS_EXPORT Label : public Widget class QTCREATOR_UTILS_EXPORT Label : public Widget

View File

@@ -368,6 +368,8 @@ void setupGuiModule()
&Widget::show, &Widget::show,
"activateWindow", "activateWindow",
&Widget::activateWindow, &Widget::activateWindow,
"close",
&Widget::close,
sol::base_classes, sol::base_classes,
sol::bases<Object, Thing>()); sol::bases<Object, Thing>());

View File

@@ -41,6 +41,9 @@ function gui.widget:show() end
---Sets the top-level widget containing this widget to be the active window. (see [QWidget::activateWindow](https://doc.qt.io/qt-5/qwidget.html#activateWindow)) ---Sets the top-level widget containing this widget to be the active window. (see [QWidget::activateWindow](https://doc.qt.io/qt-5/qwidget.html#activateWindow))
function gui.widget:activateWindow() end function gui.widget:activateWindow() end
---Closes the widget. (see [QWidget::close](https://doc.qt.io/qt-5/qwidget.html#close))
function gui.widget:close() end
---Column layout ---Column layout
---@class Column : Layout ---@class Column : Layout
local column = {} local column = {}