From ce667bf4b2f3de7aab677ac7e7f23bc72d3db80f Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 25 Jul 2007 09:11:31 +0000 Subject: migrated all widgets to use QDomNodes; Implemented the getName functionality --- client/widgets/checkbox.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/widgets/checkbox.cc') diff --git a/client/widgets/checkbox.cc b/client/widgets/checkbox.cc index ae9f143..33cd9d1 100644 --- a/client/widgets/checkbox.cc +++ b/client/widgets/checkbox.cc @@ -26,9 +26,17 @@ */ #include "checkbox.h" -CheckBox::CheckBox(QWidget *parent) : QCheckBox(parent) +CheckBox::CheckBox(QDomNode node) : QCheckBox() { - setText("Checkbox"); + QDomElement elem = node.toElement(); + widget_name = elem.attribute("name"); + setText(elem.attribute("caption")); + + if(elem.attribute("value") == "true") { + setChecked(true); + } else if (elem.attribute("value") == "false") { + setChecked(false); + } } QString CheckBox::getValue() -- cgit v1.2.3