summaryrefslogtreecommitdiff
path: root/client/widgets/groupbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/groupbox.cc')
-rw-r--r--client/widgets/groupbox.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/client/widgets/groupbox.cc b/client/widgets/groupbox.cc
index 9dc36ec..4d40dca 100644
--- a/client/widgets/groupbox.cc
+++ b/client/widgets/groupbox.cc
@@ -28,6 +28,8 @@
#include <QVBoxLayout>
#include <QHBoxLayout>
+#include <string.h>
+
GroupBox::GroupBox(QDomNode &node, MacroWindow *macrowindow)
: QGroupBox(), Widget(node, macrowindow)
{
@@ -35,8 +37,33 @@ GroupBox::GroupBox(QDomNode &node, MacroWindow *macrowindow)
if(elem.hasAttribute("caption")) {
setTitle(elem.attribute("caption"));
- } else {
- setTitle(elem.attribute(""));
+ }
+
+ 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")) {