diff options
author | deva <deva> | 2010-08-13 08:24:46 +0000 |
---|---|---|
committer | deva <deva> | 2010-08-13 08:24:46 +0000 |
commit | db2fdbe872cc6c1b224a1c4c735fac4369b3802e (patch) | |
tree | cb85d03da44b457c97c2595f8550d91ea7bb6a6d /client/widgets/widget.cc | |
parent | bc229dbfabdf6a59453605e7652f04a268605b3a (diff) |
Add missing children widgets to actual layouts.
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r-- | client/widgets/widget.cc | 14 |
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(); } |