summaryrefslogtreecommitdiff
path: root/client/widgets/common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/common.cc')
-rw-r--r--client/widgets/common.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/widgets/common.cc b/client/widgets/common.cc
index 3d4458d..c545ed8 100644
--- a/client/widgets/common.cc
+++ b/client/widgets/common.cc
@@ -82,14 +82,18 @@ void setCommonLayout(QWidget *widget, QDomNode &node)
if(elem.hasAttribute("layout")) {
if(elem.attribute("layout") == "hbox") {
- QHBoxLayout *layout = new QHBoxLayout();
+ QHBoxLayout *layout = new QHBoxLayout(widget);
widget->setLayout(layout);
} else if (elem.attribute("layout") == "vbox") {
- QVBoxLayout *layout = new QVBoxLayout();
+ QVBoxLayout *layout = new QVBoxLayout(widget);
+ widget->setLayout(layout);
+ } else { // Illigal layout choosen.
+ QVBoxLayout *layout = new QVBoxLayout(widget);
widget->setLayout(layout);
}
+
} else {
- QHBoxLayout *layout = new QHBoxLayout();
+ QHBoxLayout *layout = new QHBoxLayout(widget);
widget->setLayout(layout);
}