summaryrefslogtreecommitdiff
path: root/client/widgets/label.cc
diff options
context:
space:
mode:
authorsenator <senator>2007-07-23 07:40:05 +0000
committersenator <senator>2007-07-23 07:40:05 +0000
commit22de7bf19fb6fcce8d11c0e01afdfafa2a8c00d6 (patch)
treeb841931e88a673e04a26f2709066c018d9df4f68 /client/widgets/label.cc
parentd614b0436f0ce1f060fc80b987ca4209f17c221e (diff)
porting widgets to use QDomNodes
Diffstat (limited to 'client/widgets/label.cc')
-rw-r--r--client/widgets/label.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index 377fd10..b30d1cb 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -27,15 +27,16 @@
#include "label.h"
#include <stdio.h>
-Label::Label(QWidget *parent, QString text, QString align) : QLabel(parent)
+Label::Label(QDomNode node) : QLabel(NULL)
{
- setText(text);
+ QDomElement elem = node.toElement();
+ setText(elem.attribute("caption"));
- if(align == "left") {
+ if(elem.attribute("align") == "left") {
setAlignment(Qt::AlignLeft);
- } else if (align == "center") {
+ } else if (elem.attribute("align") == "center") {
setAlignment(Qt::AlignHCenter);
- } else if (align == "right") {
+ } else if (elem.attribute("align") == "right") {
setAlignment(Qt::AlignRight);
}
}