1 #include "InfoPanelLabel.h"
3 InfoPanelLabel::InfoPanelLabel(QWidget *parent, QRect &r):QLabel(parent),rect(r)
7 void InfoPanelLabel::Init(int pos, int height, const QString &text, QFont *font)
15 setStyleSheet("QLabel { background-color : white; color : #FFFFFF; }");
16 setGeometry(QRect(rect.x(), rect.y()+pos, rect.width(), height));
18 /* if text is too big, align left so that we can at least read the beginning : */
19 if (this->text().length() > 0 && this->fontMetrics().width(this->text()) >= rect.width())
20 setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
22 setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);