summaryrefslogtreecommitdiff
path: root/client/widgets/groupbox.cc
diff options
context:
space:
mode:
authordeva <deva>2008-08-28 14:13:48 +0000
committerdeva <deva>2008-08-28 14:13:48 +0000
commit477c9fd7f038cd43207c8634d53d0949814ecb4c (patch)
tree4d4f849c281aa4402c3f7bd95546c21ebe287e55 /client/widgets/groupbox.cc
parentb74d14e7e8625ce1a148105f69e3406f7d88ecd6 (diff)
Added common stuff in central file. Fixed help text reformatting.
Diffstat (limited to 'client/widgets/groupbox.cc')
-rw-r--r--client/widgets/groupbox.cc49
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);
}