diff options
author | senator <senator> | 2007-07-23 07:40:05 +0000 |
---|---|---|
committer | senator <senator> | 2007-07-23 07:40:05 +0000 |
commit | 22de7bf19fb6fcce8d11c0e01afdfafa2a8c00d6 (patch) | |
tree | b841931e88a673e04a26f2709066c018d9df4f68 /client/widgets/radiobutton.cc | |
parent | d614b0436f0ce1f060fc80b987ca4209f17c221e (diff) |
porting widgets to use QDomNodes
Diffstat (limited to 'client/widgets/radiobutton.cc')
-rw-r--r-- | client/widgets/radiobutton.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/client/widgets/radiobutton.cc b/client/widgets/radiobutton.cc index cad1ebf..89f9f4f 100644 --- a/client/widgets/radiobutton.cc +++ b/client/widgets/radiobutton.cc @@ -26,9 +26,25 @@ */ #include "radiobutton.h" -RadioButton::RadioButton(QWidget *parent) : QRadioButton(parent) +RadioButton::RadioButton(QDomNode node) : QRadioButton() { - setText("Radio button"); + QDomElement elem = node.toElement(); + + if(elem.hasAttribute("caption")) { + setText(elem.attribute("caption")); + } else { + setText(""); + } + + if(elem.hasAttribute("value")) { + if(elem.attribute("value") == "true") { + setChecked(true); + } else if(elem.attribute("value") == "false") { + setChecked(false); + } + } else { + setChecked(false); + } } QString RadioButton::getValue() |