5#include <Kanoop/gui/libkanoopgui.h>
15class LIBKANOOPGUI_EXPORT
Label :
public QLabel
20 Q_PROPERTY(QColor foregroundColor READ foregroundColor WRITE setForegroundColor)
22 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
29 explicit
Label(QWidget *parent =
nullptr, Qt::WindowFlags f=Qt::WindowFlags());
37 explicit
Label(const QString &text, QWidget *parent =
nullptr, Qt::WindowFlags f=Qt::WindowFlags());
43 void setFontPointSize(
int size);
49 void setFontPixelSize(
int size);
55 QColor foregroundColor()
const {
return _foregroundColor; }
89 QColor _backgroundColor;
90 QColor _foregroundColor;
91 bool _backgroundExplicitlySet =
false;
92 bool _foregroundExplicitlySet =
false;
QLabel subclass with font size and color Q_PROPERTYs.
void setDefaultBackgroundColor()
Reset the background color to the palette default.
void setBackgroundColor(const QColor &color)
Set the background color and repaint.
void setDefaultForegroundColor()
Reset the foreground color to the palette default.
virtual void applyStylesheet()
Rebuild and apply the stylesheet from current color properties.
QColor backgroundColor() const
Return the current background color.
void setForegroundColor(const QColor &color)
Set the foreground (text) color and repaint.