summaryrefslogtreecommitdiff
path: root/client/widgets/radiobutton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/radiobutton.cc')
-rw-r--r--client/widgets/radiobutton.cc20
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()