forked from qt-creator/qt-creator
Lua: Make Layout-derived classes directly show-able
Change-Id: I2bea8187626c239b5b2e9ddb32d291db97ddc9ac Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -686,6 +686,11 @@ QWidget *Layout::emerge() const
|
|||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Layout::show() const
|
||||||
|
{
|
||||||
|
return emerge()->show();
|
||||||
|
}
|
||||||
|
|
||||||
// "Widgets"
|
// "Widgets"
|
||||||
|
|
||||||
Widget::Widget(std::initializer_list<I> ps)
|
Widget::Widget(std::initializer_list<I> ps)
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public:
|
|||||||
void fieldGrowthPolicy(int policy);
|
void fieldGrowthPolicy(int policy);
|
||||||
|
|
||||||
QWidget *emerge() const;
|
QWidget *emerge() const;
|
||||||
|
void show() const;
|
||||||
|
|
||||||
QFormLayout *asForm();
|
QFormLayout *asForm();
|
||||||
QGridLayout *asGrid();
|
QGridLayout *asGrid();
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ SOL_BASE_CLASSES(Layouting::Row, Layouting::Layout);
|
|||||||
SOL_BASE_CLASSES(Layouting::Flow, Layouting::Layout);
|
SOL_BASE_CLASSES(Layouting::Flow, Layouting::Layout);
|
||||||
SOL_BASE_CLASSES(Layouting::Grid, Layouting::Layout);
|
SOL_BASE_CLASSES(Layouting::Grid, Layouting::Layout);
|
||||||
SOL_BASE_CLASSES(Layouting::Form, Layouting::Layout);
|
SOL_BASE_CLASSES(Layouting::Form, Layouting::Layout);
|
||||||
SOL_BASE_CLASSES(Layouting::Widget, Layouting::Widget);
|
SOL_BASE_CLASSES(Layouting::Widget, Layouting::Object);
|
||||||
SOL_BASE_CLASSES(Layouting::Stack, Layouting::Widget);
|
SOL_BASE_CLASSES(Layouting::Stack, Layouting::Widget);
|
||||||
SOL_BASE_CLASSES(Layouting::Tab, Layouting::Widget);
|
SOL_BASE_CLASSES(Layouting::Tab, Layouting::Widget);
|
||||||
SOL_BASE_CLASSES(Layouting::Group, Layouting::Widget);
|
SOL_BASE_CLASSES(Layouting::Group, Layouting::Widget);
|
||||||
|
|||||||
@@ -231,6 +231,15 @@ void addLayoutModule()
|
|||||||
"Stretch", sol::call_constructor, sol::constructors<Stretch(int)>());
|
"Stretch", sol::call_constructor, sol::constructors<Stretch(int)>());
|
||||||
|
|
||||||
// Layouts
|
// Layouts
|
||||||
|
layout.new_usertype<Layout>(
|
||||||
|
"Layout",
|
||||||
|
sol::call_constructor,
|
||||||
|
sol::factories(&construct<Layout>),
|
||||||
|
"show",
|
||||||
|
&Layout::show,
|
||||||
|
sol::base_classes,
|
||||||
|
sol::bases<Object, Thing>());
|
||||||
|
|
||||||
layout.new_usertype<Form>(
|
layout.new_usertype<Form>(
|
||||||
"Form",
|
"Form",
|
||||||
sol::call_constructor,
|
sol::call_constructor,
|
||||||
|
|||||||
Reference in New Issue
Block a user