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.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index b6f93b5..b1875e4 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -30,8 +30,19 @@
Label::Label(QDomNode node) : QLabel()
{
QDomElement elem = node.toElement();
- widget_name = elem.attribute("name");
- setText(elem.attribute("caption"));
+
+ if(elem.hasAttribute("name")) {
+ widget_name = elem.attribute("name");
+ } else {
+ printf("XML ERROR!! Unnamed widget of type: %s\n",
+ elem.tagName().toStdString().c_str());
+ }
+
+ if(elem.hasAttribute("caption")) {
+ setText(elem.attribute("caption"));
+ } else {
+ setText(elem.attribute(""));
+ }
if(elem.hasAttribute("align")) {
if(elem.attribute("align") == "left") {
@@ -41,6 +52,8 @@ Label::Label(QDomNode node) : QLabel()
} else if (elem.attribute("align") == "right") {
setAlignment(Qt::AlignRight);
}
+ } else {
+ setAlignment(Qt::AlignLeft);
}
}