From 477c9fd7f038cd43207c8634d53d0949814ecb4c Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Aug 2008 14:13:48 +0000 Subject: Added common stuff in central file. Fixed help text reformatting. --- client/widgets/window.cc | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'client/widgets/window.cc') diff --git a/client/widgets/window.cc b/client/widgets/window.cc index c385d04..84e370c 100644 --- a/client/widgets/window.cc +++ b/client/widgets/window.cc @@ -25,29 +25,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "window.h" -#include -#include +#include "common.h" Window::Window(QDomNode &node, MacroWindow *macrowindow) : QWidget(NULL), Widget(node, macrowindow) { setWindowFlags(Qt::WindowContextHelpButtonHint | Qt::WindowSystemMenuHint); - QDomElement elem = node.toElement(); - - if(elem.hasAttribute("width")) { - setMinimumWidth(elem.attribute("width").toInt()); - resize(elem.attribute("width").toInt(), height()); - } + setCommonAttributes(this, node); + setCommonLayout(this, node); - if(elem.hasAttribute("height")) { - setMinimumHeight(elem.attribute("height").toInt()); - resize(width(), elem.attribute("height").toInt()); - } - - if(elem.hasAttribute("help")) { - setToolTip(elem.attribute("help")); - } + QDomElement elem = node.toElement(); if(elem.hasAttribute("fixed")) { if(elem.attribute("fixed") == "true") { @@ -57,19 +45,5 @@ Window::Window(QDomNode &node, MacroWindow *macrowindow) if(elem.hasAttribute("caption")) { setWindowTitle(elem.attribute("caption")); - } else { - setWindowTitle(elem.attribute("")); } - - if(elem.hasAttribute("layout")) { - if(elem.attribute("layout") == "hbox") { - QHBoxLayout *layout = new QHBoxLayout(); - setLayout(layout); - } else if (elem.attribute("layout") == "vbox") { - QVBoxLayout *layout = new QVBoxLayout(); - setLayout(layout); - } - } - - setContentsMargins(0,0,0,0); } -- cgit v1.2.3