2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-01 23:33:33 +00:00
metaforce/hecl-gui/ErrorLabel.hpp
2018-10-06 17:41:18 -10:00

21 lines
485 B
C++

#pragma once
#include <QLabel>
class ErrorLabel : public QLabel
{
public:
ErrorLabel(QWidget* parent = Q_NULLPTR) : QLabel(parent) {}
void setText(const QString& str, bool success = false)
{
QPalette pal = QLabel::palette();
if (success)
pal.setColor(QPalette::WindowText, QColor(0,255,0));
else
pal.setColor(QPalette::WindowText, QColor(255,47,0));
QLabel::setPalette(pal);
QLabel::setText(str);
}
};