forked from qt-creator/qt-creator
Lua: Add additional bindings for Widget Type
Change-Id: Iea5089e44d550223e157b2e75c827bc6077d9238 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -740,6 +740,26 @@ void Widget::show()
|
||||
access(this)->show();
|
||||
}
|
||||
|
||||
bool Widget::isVisible() const
|
||||
{
|
||||
return access(this)->isVisible();
|
||||
}
|
||||
|
||||
bool Widget::isEnabled() const
|
||||
{
|
||||
return access(this)->isEnabled();
|
||||
}
|
||||
|
||||
void Widget::setVisible(bool visible)
|
||||
{
|
||||
access(this)-> setVisible(visible);
|
||||
}
|
||||
|
||||
void Widget::setEnabled(bool enabled)
|
||||
{
|
||||
access(this)->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void Widget::setNoMargins(int)
|
||||
{
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
@@ -231,6 +231,12 @@ public:
|
||||
QWidget *emerge() const;
|
||||
void show();
|
||||
|
||||
bool isVisible() const;
|
||||
bool isEnabled() const;
|
||||
|
||||
void setVisible(bool);
|
||||
void setEnabled(bool);
|
||||
|
||||
void setAutoFillBackground(bool);
|
||||
void setLayout(const Layout &layout);
|
||||
void setSize(int, int);
|
||||
|
@@ -430,6 +430,10 @@ void setupGuiModule()
|
||||
&Widget::activateWindow,
|
||||
"close",
|
||||
&Widget::close,
|
||||
"visible",
|
||||
sol::property(&Widget::isVisible, &Widget::setVisible),
|
||||
"enabled",
|
||||
sol::property(&Widget::isEnabled, &Widget::setEnabled),
|
||||
sol::base_classes,
|
||||
sol::bases<Object, Thing>());
|
||||
|
||||
|
@@ -12,6 +12,8 @@ gui.layout = {}
|
||||
|
||||
---The base class of all widget classes, an empty widget itself.
|
||||
---@class Widget : Object
|
||||
---@field visible bool Whether the widget is visible or not.
|
||||
---@field enabled bool Whether the widget is enabled or not.
|
||||
gui.widget = {}
|
||||
|
||||
---@alias LayoutChild string|BaseAspect|Layout|Widget|function
|
||||
|
Reference in New Issue
Block a user