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.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/client/widgets/common.cc b/client/widgets/common.cc
index c545ed8..2262074 100644
--- a/client/widgets/common.cc
+++ b/client/widgets/common.cc
@@ -80,21 +80,10 @@ void setCommonLayout(QWidget *widget, QDomNode &node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("layout")) {
- if(elem.attribute("layout") == "hbox") {
- QHBoxLayout *layout = new QHBoxLayout(widget);
- widget->setLayout(layout);
- } else if (elem.attribute("layout") == "vbox") {
- QVBoxLayout *layout = new QVBoxLayout(widget);
- widget->setLayout(layout);
- } else { // Illigal layout choosen.
- QVBoxLayout *layout = new QVBoxLayout(widget);
- widget->setLayout(layout);
- }
-
+ if(elem.attribute("layout", "vbox") == "hbox") {
+ widget->setLayout(new QHBoxLayout(widget));
} else {
- QHBoxLayout *layout = new QHBoxLayout(widget);
- widget->setLayout(layout);
+ widget->setLayout(new QVBoxLayout(widget));
}
widget->setContentsMargins(0,0,0,0);