From 843221d0826ed0a53a94e84772f89c482f80776a Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 13 Aug 2010 13:53:41 +0000 Subject: Add default layout, if illigal type is specified (crash bug). --- client/widgets/common.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client/widgets/common.cc') 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); } -- cgit v1.2.3