From 6389aabffe198ece92b58ae34a905902c7eefe7c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 28 Jun 2011 06:38:10 +0000 Subject: Complete rewrite of the way lua widget methods, 'inheritance' in particular, are handled. --- client/widgets/common.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'client/widgets/common.cc') 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); -- cgit v1.2.3