diff options
Diffstat (limited to 'client/widgetbuilder.cc')
-rw-r--r-- | client/widgetbuilder.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/client/widgetbuilder.cc b/client/widgetbuilder.cc index e688f60..3d47d41 100644 --- a/client/widgetbuilder.cc +++ b/client/widgetbuilder.cc @@ -107,8 +107,26 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow widgets.push_back(multilist); widget = multilist; - if(parent != NULL && widget != NULL) parent->layout()->addWidget(widget); - if(widget != NULL) widget->show(); + if(parent && widget && parent->layout()) parent->layout()->addWidget(widget); + if(widget) widget->show(); + + return widgets; // Don't iterate children + } else if(xml_elem.tagName() == "altcombobox") { + AltComboBox *altcombobox = new AltComboBox(xml_elem, macrowindow); + widgets.push_back(altcombobox); + widget = altcombobox; + + if(parent && widget && parent->layout()) parent->layout()->addWidget(widget); + if(widget) widget->show(); + + return widgets; // Don't iterate children + } else if(xml_elem.tagName() == "metawidget") { + MetaWidget *metawidget = new MetaWidget(xml_elem, macrowindow); + widgets.push_back(metawidget); + widget = metawidget; + + if(parent && widget && parent->layout()) parent->layout()->addWidget(widget); + if(widget) widget->show(); return widgets; // Don't iterate children } @@ -120,8 +138,8 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow widgets += widgetBuilder(child, widget, macrowindow); } - if(parent != NULL && widget != NULL) parent->layout()->addWidget(widget); - if(widget != NULL) widget->show(); + if(parent && widget && parent->layout()) parent->layout()->addWidget(widget); + if(widget) widget->show(); return widgets; } |