2021-11-18 14:58:01 +00:00
|
|
|
#include "info_label.h"
|
2018-08-27 08:50:40 +00:00
|
|
|
#include "theme.h"
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <QHBoxLayout>
|
2018-08-27 08:50:40 +00:00
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
InfoLabel::InfoLabel(const QString& text, QWidget* parent)
|
|
|
|
: QWidget(parent)
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
|
|
|
m_icon = new QLabel(QChar(fa::infocircle));
|
|
|
|
Theme::initAwesomeLabel(m_icon);
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-08-27 08:50:40 +00:00
|
|
|
m_label = new QLabel(text);
|
2018-09-14 09:45:05 +00:00
|
|
|
m_label->setWordWrap(true);
|
2022-10-18 09:35:04 +00:00
|
|
|
|
|
|
|
QHBoxLayout* mainLayout = new QHBoxLayout;
|
2018-08-27 08:50:40 +00:00
|
|
|
mainLayout->addWidget(m_icon);
|
|
|
|
mainLayout->addWidget(m_label);
|
2018-10-02 04:59:30 +00:00
|
|
|
mainLayout->addStretch();
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-08-27 08:50:40 +00:00
|
|
|
setLayout(mainLayout);
|
|
|
|
}
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
void InfoLabel::setText(const QString& text)
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
|
|
|
m_label->setText(text);
|
|
|
|
}
|