summaryrefslogtreecommitdiff
path: root/client/widgets/radiobutton.cc
diff options
context:
space:
mode:
authorsenator <senator>2007-10-02 10:08:09 +0000
committersenator <senator>2007-10-02 10:08:09 +0000
commit9910c8962ab813ab7d9a04609b689e1d9ae038e0 (patch)
tree5ca422f7c3e4cfffed3f57d6201f75ed10986578 /client/widgets/radiobutton.cc
parent4cbb885daf4ce4a4fb9827c5d6b67e9f82f730d3 (diff)
selectable entries now uses xml items correctly
Diffstat (limited to 'client/widgets/radiobutton.cc')
-rw-r--r--client/widgets/radiobutton.cc28
1 files changed, 19 insertions, 9 deletions
diff --git a/client/widgets/radiobutton.cc b/client/widgets/radiobutton.cc
index 0645745..00c12b9 100644
--- a/client/widgets/radiobutton.cc
+++ b/client/widgets/radiobutton.cc
@@ -25,30 +25,40 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "radiobutton.h"
+#include <QRadioButton>
-RadioButton::RadioButton(QDomNode node)
- : QRadioButton(), Widget(node)
+RadioButton::RadioButton(QDomNode node, bool radio_bool)
+ : QRadioButton()
{
QDomElement elem = node.toElement();
+ if(elem.hasAttribute("width")) {
+ resize(elem.attribute("width").toInt(), height());
+ }
+
+ if(elem.hasAttribute("height")) {
+ resize(width(), elem.attribute("height").toInt());
+ }
+
if(elem.hasAttribute("caption")) {
setText(elem.attribute("caption"));
} else {
setText("");
}
- if(elem.hasAttribute("value")) {
- if(elem.attribute("value") == "true") {
+ if(radio_bool) {
setChecked(true);
- } else if(elem.attribute("value") == "false") {
- setChecked(false);
- }
+ } else setChecked(false);
+
+ if(elem.hasAttribute("value")) {
+ radio_value = elem.attribute("value");
} else {
- setChecked(false);
+ printf("XML ERROR!!! Radiobutton item has no value\n");
+ radio_value = "none";
}
}
QString RadioButton::getValue()
{
- return "radiobutton";
+ return radio_value;
}