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();
|
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)
|
void Widget::setNoMargins(int)
|
||||||
{
|
{
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
@@ -231,6 +231,12 @@ public:
|
|||||||
QWidget *emerge() const;
|
QWidget *emerge() const;
|
||||||
void show();
|
void show();
|
||||||
|
|
||||||
|
bool isVisible() const;
|
||||||
|
bool isEnabled() const;
|
||||||
|
|
||||||
|
void setVisible(bool);
|
||||||
|
void setEnabled(bool);
|
||||||
|
|
||||||
void setAutoFillBackground(bool);
|
void setAutoFillBackground(bool);
|
||||||
void setLayout(const Layout &layout);
|
void setLayout(const Layout &layout);
|
||||||
void setSize(int, int);
|
void setSize(int, int);
|
||||||
|
@@ -430,6 +430,10 @@ void setupGuiModule()
|
|||||||
&Widget::activateWindow,
|
&Widget::activateWindow,
|
||||||
"close",
|
"close",
|
||||||
&Widget::close,
|
&Widget::close,
|
||||||
|
"visible",
|
||||||
|
sol::property(&Widget::isVisible, &Widget::setVisible),
|
||||||
|
"enabled",
|
||||||
|
sol::property(&Widget::isEnabled, &Widget::setEnabled),
|
||||||
sol::base_classes,
|
sol::base_classes,
|
||||||
sol::bases<Object, Thing>());
|
sol::bases<Object, Thing>());
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@ gui.layout = {}
|
|||||||
|
|
||||||
---The base class of all widget classes, an empty widget itself.
|
---The base class of all widget classes, an empty widget itself.
|
||||||
---@class Widget : Object
|
---@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 = {}
|
gui.widget = {}
|
||||||
|
|
||||||
---@alias LayoutChild string|BaseAspect|Layout|Widget|function
|
---@alias LayoutChild string|BaseAspect|Layout|Widget|function
|
||||||
|
Reference in New Issue
Block a user