diff options
author | deva <deva> | 2011-06-28 06:38:10 +0000 |
---|---|---|
committer | deva <deva> | 2011-06-28 06:38:10 +0000 |
commit | 6389aabffe198ece92b58ae34a905902c7eefe7c (patch) | |
tree | cfda4b340e462e5193f4ac2e6814cce5d707ca4f /client/widgets/common.cc | |
parent | 01febc40e2aad29bf6cf6cbeb457c44354aba0f9 (diff) |
Complete rewrite of the way lua widget methods, 'inheritance' in particular, are handled.
Diffstat (limited to 'client/widgets/common.cc')
-rw-r--r-- | client/widgets/common.cc | 17 |
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); |