summaryrefslogtreecommitdiff
path: root/client/widgets/label.cc
diff options
context:
space:
mode:
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();
+}