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/groupbox.cc | 49 +++++----------------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) (limited to 'client/widgets/groupbox.cc') diff --git a/client/widgets/groupbox.cc b/client/widgets/groupbox.cc index 4d40dca..2bf696f 100644 --- a/client/widgets/groupbox.cc +++ b/client/widgets/groupbox.cc @@ -30,56 +30,17 @@ #include +#include "common.h" + GroupBox::GroupBox(QDomNode &node, MacroWindow *macrowindow) : QGroupBox(), Widget(node, macrowindow) { + setCommonAttributes(this, node); + setCommonLayout(this, node); + QDomElement elem = node.toElement(); if(elem.hasAttribute("caption")) { setTitle(elem.attribute("caption")); } - - if(elem.hasAttribute("help")) { - setWhatsThis(elem.attribute("help")); - } - if(elem.hasAttribute("help")) { - QString helptext = elem.attribute("help"); - - int idx = 0; - while(idx < helptext.length() - 1) { - if(helptext[idx] == '\\' && helptext[idx+1] == 'n') { - helptext[idx] = '\n'; - helptext[idx+1] = '\n'; - } - idx++; - } - - idx = 60; - while(idx < helptext.length()) { - while(idx < helptext.length() && helptext[idx] != ' ') { - idx++; - } - helptext[idx] = '\n'; - - idx += 60; - } - setToolTip(helptext); - } - - 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); - } - } else { - QHBoxLayout *layout = new QHBoxLayout(); - setLayout(layout); - } - - // setLineWidth(0); - // setMidLineWidth(0); - setContentsMargins(0,10,0,0); } -- cgit v1.2.3