diff options
Diffstat (limited to 'client/widgets/groupbox.cc')
-rw-r--r-- | client/widgets/groupbox.cc | 49 |
1 files changed, 5 insertions, 44 deletions
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 <string.h> +#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); } |