Provide a LayoutView constructor even without Qt bindings enabled

This commit is contained in:
Matthias Koefferlein 2020-04-18 22:56:34 +02:00
parent df11ff9b85
commit 0066381b40
1 changed files with 19 additions and 1 deletions

View File

@ -414,9 +414,14 @@ static lay::LayoutView *new_view (QWidget *parent, bool editable, db::Manager *m
}
#endif
static lay::LayoutView *new_view2 (bool editable, db::Manager *manager, unsigned int options)
{
return new lay::LayoutView (manager, editable, 0 /*plugin parent*/, 0 /*parent*/, "view", options);
}
Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutView",
#if defined(HAVE_QTBINDINGS)
gsi::constructor ("new", &new_view, gsi::arg ("parent", (QWidget *) 0, "nil"), gsi::arg ("editable", false), gsi::arg ("manager", (db::Manager *) 0, "nil"), gsi::arg ("options", (unsigned int) 0),
gsi::constructor ("new", &new_view, gsi::arg ("parent"), gsi::arg ("editable", false), gsi::arg ("manager", (db::Manager *) 0, "nil"), gsi::arg ("options", (unsigned int) 0),
"@brief Creates a standalone view\n"
"\n"
"This constructor is for special purposes only. To create a view in the context of a main window, "
@ -431,6 +436,19 @@ Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "Layou
"It has been enhanced with the arguments in version 0.27.\n"
) +
#endif
gsi::constructor ("new", &new_view2, gsi::arg ("editable", false), gsi::arg ("manager", (db::Manager *) 0, "nil"), gsi::arg ("options", (unsigned int) 0),
"@brief Creates a standalone view\n"
"\n"
"This constructor is for special purposes only. To create a view in the context of a main window, "
"use \\MainWindow#create_view and related methods.\n"
"\n"
"@param editable True to make the view editable\n"
"@param manager The \\Manager object to enable undo/redo\n"
"@param options A combination of the values in the LV_... constants\n"
"\n"
"This constructor has been introduced in version 0.25.\n"
"It has been enhanced with the arguments in version 0.27.\n"
) +
gsi::constant ("LV_NoLayers", (unsigned int) lay::LayoutView::LV_NoLayers,
"@brief With this option, no layers view will be provided (see \\layer_control_frame)\n"
"Use this value with the constructor's 'options' argument.\n"