summaryrefslogtreecommitdiff
path: root/client/widgets/common.cc
diff options
context:
space:
mode:
authordeva <deva>2010-08-13 13:53:41 +0000
committerdeva <deva>2010-08-13 13:53:41 +0000
commit843221d0826ed0a53a94e84772f89c482f80776a (patch)
tree551b414c756d428e205a99bd7f51b075bd5107f3 /client/widgets/common.cc
parent37cd747953facf8c4ffed40dcef175391d15c388 (diff)
Add default layout, if illigal type is specified (crash bug).
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);
}