summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r--client/widgets/widget.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index 2205beb..93deb31 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -90,12 +90,12 @@ Widget::~Widget()
}
}
-void Widget::addChildren(QDomNode &node)
+void Widget::addChildren(QDomNode &node, QLayout *layout)
{
QDomNodeList children = node.childNodes();
for (int i=0; i<children.count();i++) {
QDomNode child = children.at(i);
- widgetBuilder(child);
+ widgetBuilder(child, layout);
}
}
@@ -236,7 +236,7 @@ void Widget::addChild(Widget *widget)
connect(widget, SIGNAL(wasChanged()), this, SLOT(childWasChanged()));
}
-void Widget::widgetBuilder(QDomNode &xml_node)
+void Widget::widgetBuilder(QDomNode &xml_node, QLayout *layout)
{
QDomElement xml_elem = xml_node.toElement();
@@ -250,9 +250,8 @@ void Widget::widgetBuilder(QDomNode &xml_node)
Widget *widget = NULL;
if(xml_elem.tagName() == "spacer") {
- if(qwidget() && qwidget()->layout()) {
- ((QBoxLayout*)qwidget()->layout())->addStretch();
- }
+ if(layout) ((QBoxLayout*)layout)->addStretch();
+
return; // This is not a real widget.
} else if(xml_elem.tagName() == "frame") {
@@ -333,8 +332,7 @@ void Widget::widgetBuilder(QDomNode &xml_node)
addChild(widget);
- if(qwidget() && qwidget()->layout())
- qwidget()->layout()->addWidget(widget->qwidget());
+ if(layout) layout->addWidget(widget->qwidget());
if(widget && widget->qwidget()) widget->qwidget()->show();
}