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.cc56
1 files changed, 17 insertions, 39 deletions
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index fc81099..d9a5814 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -27,68 +27,46 @@
#include "label.h"
#include <stdio.h>
+#include <QLabel>
+
#include "common.h"
Label::Label(QDomNode &node, MacroWindow *macrowindow)
- : QLabel(), Widget(node, macrowindow)
+ : Widget(node, macrowindow)
{
+ label = new QLabel();
+ widget = label;
+
QDomElement elem = node.toElement();
- setCommonAttributes(this, node);
+ setCommonAttributes(label, node);
- setWordWrap(true);
+ label->setWordWrap(true);
if(elem.hasAttribute("caption")) {
- setText(elem.attribute("caption"));
+ label->setText(elem.attribute("caption"));
} else {
- setText(elem.attribute(""));
+ label->setText(elem.attribute(""));
}
// Check for horizontal alignment and set it up accordingly
if(elem.hasAttribute("alignment")) {
if(elem.attribute("alignment") == "left") {
- setAlignment(Qt::AlignLeft);
+ label->setAlignment(Qt::AlignLeft);
} else if (elem.attribute("alignment") == "center") {
- setAlignment(Qt::AlignHCenter);
+ label->setAlignment(Qt::AlignHCenter);
} else if (elem.attribute("alignment") == "right") {
- setAlignment(Qt::AlignRight);
+ label->setAlignment(Qt::AlignRight);
}
} else {
- setAlignment(Qt::AlignLeft);
+ label->setAlignment(Qt::AlignLeft);
}
// Always center vertically in the addressed space
- setAlignment(Qt::AlignVCenter);
-}
-
-void Label::connectFrom(const char *signal,
- const QObject *receiver, const char *method)
-{
- connect(this, signal, receiver, method);
-}
-
-void Label::connectTo(const QObject *sender, const char *signal,
- const char *method)
-{
- connect(sender, signal, this, method);
-}
-
-void Label::setVisibility(bool visible)
-{
- setVisible(visible);
-}
-
-void Label::enable()
-{
- setEnabled(true);
-}
-
-void Label::disable()
-{
- setEnabled(false);
+ label->setAlignment(Qt::AlignVCenter);
}
-bool Label::isDisabled()
+Label::~Label()
{
- return isEnabled() == false;
+ // delete label;
}