qt/LedOK/LoQClass/locolorselector.h

33 lines
639 B
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef LOCOLORSELECTOR_H
#define LOCOLORSELECTOR_H
#include <QColor>
#include <QColorDialog>
#include <QPushButton>
class LoColorSelector : public QPushButton
{
Q_OBJECT
public:
explicit LoColorSelector(QWidget *parent = nullptr);
explicit LoColorSelector(const QString &text, const QColor &color, QWidget *parent = nullptr);
private:
void init();
public:
void setColor(const QColor &color);
QColor color() const { return m_color; }
signals:
void sColorChanged(const QColor &);
protected slots:
void onColorChanged();
private:
QString m_text;
QColor m_color;
};
#endif // LOCOLORSELECTOR_H