From 3eebecacd576c35605aff01324ec66ad9825b0d7 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 20 Aug 2008 10:28:35 +0000 Subject: Fixed various small bugs. --- client/widgets/groupbox.cc | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'client/widgets/groupbox.cc') 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 #include +#include + 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")) { -- cgit v1.2.3