33 lines
639 B
C++
33 lines
639 B
C++
#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
|