summaryrefslogtreecommitdiff
path: root/client/widgets/label.cc
diff options
context:
space:
mode:
authorsenator <senator>2007-07-25 09:11:31 +0000
committersenator <senator>2007-07-25 09:11:31 +0000
commitce667bf4b2f3de7aab677ac7e7f23bc72d3db80f (patch)
tree760a18ca48e59274553ca6c211c08770f031ad56 /client/widgets/label.cc
parent22de7bf19fb6fcce8d11c0e01afdfafa2a8c00d6 (diff)
migrated all widgets to use QDomNodes; Implemented the getName functionality
Diffstat (limited to 'client/widgets/label.cc')
-rw-r--r--client/widgets/label.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index b30d1cb..b6f93b5 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -27,16 +27,24 @@
#include "label.h"
#include <stdio.h>
-Label::Label(QDomNode node) : QLabel(NULL)
+Label::Label(QDomNode node) : QLabel()
{
QDomElement elem = node.toElement();
+ widget_name = elem.attribute("name");
setText(elem.attribute("caption"));
- if(elem.attribute("align") == "left") {
- setAlignment(Qt::AlignLeft);
- } else if (elem.attribute("align") == "center") {
- setAlignment(Qt::AlignHCenter);
- } else if (elem.attribute("align") == "right") {
- setAlignment(Qt::AlignRight);
+ if(elem.hasAttribute("align")) {
+ if(elem.attribute("align") == "left") {
+ setAlignment(Qt::AlignLeft);
+ } else if (elem.attribute("align") == "center") {
+ setAlignment(Qt::AlignHCenter);
+ } else if (elem.attribute("align") == "right") {
+ setAlignment(Qt::AlignRight);
+ }
}
}
+
+QString Label::getValue()
+{
+ return text();
+}