#include <QApplication>
#include <QPalette>
#include "text.h"
#include "manager.h"
Text::Text(QWidget *parent, int x, int y, const char *str, int s, QColor col) : QLabel(parent)
{
text = str;
size = s;
setColor(col);
setText(qApp->translate("DPF",text));
setFont(QFont(font().family(),size));
setGeometry(x, y, 350, 64);
connect(g_Manager, SIGNAL(fontChanged(QString)), this, SLOT(fontChanged(QString)));
connect(g_Manager, SIGNAL(languageChanged(QString)), this, SLOT(languageChanged(QString)));
connect(g_Manager, SIGNAL(colorChanged(QString)), this, SLOT(colorChanged(QString)));
connect(g_Manager, SIGNAL(backgroundChanged(QString)), this, SLOT(backgroundChanged(QString)));
}
Text::~Text()
{
}
void Text::setColor(QColor col)
{
QPalette pal;
pal.setColor(QPalette::WindowText, col);
setPalette(pal);
}
/*
void Text::paintEvent(QPaintEvent *pe)
{
QPainter p(this);
p.setPen(col);
p.setFont();
p.drawText(0, 0, tr(str));
}
*/
void Text::fontChanged(QString fnt)
{
setFont(QFont(fnt,size));
}
void Text::languageChanged(QString lang)
{
setText(qApp->translate("DPF",text));
}
void Text::colorChanged(QString color)
{
}
void Text::backgroundChanged(QString background)
{
}