diff options
| author | deva <deva> | 2008-08-20 10:28:35 +0000 | 
|---|---|---|
| committer | deva <deva> | 2008-08-20 10:28:35 +0000 | 
| commit | 3eebecacd576c35605aff01324ec66ad9825b0d7 (patch) | |
| tree | a4f58503967707cdc1ecab07a0b15b67d32bdab6 /client/widgets/groupbox.cc | |
| parent | 45702265ce206381bcb02a53b413ad987897b02b (diff) | |
Fixed various small bugs.
Diffstat (limited to 'client/widgets/groupbox.cc')
| -rw-r--r-- | client/widgets/groupbox.cc | 31 | 
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")) {  | 
