qt/LedOK/ColorDialog/BasicColorItem.h

36 lines
560 B
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
// 基本颜色项
#ifndef BASICCOLORITEM_H
#define BASICCOLORITEM_H
#include <QLabel>
class BasicColorItem : public QLabel
{
Q_OBJECT
public:
BasicColorItem(const QColor &, QWidget *parent = 0);
~BasicColorItem();
QColor getColor();
void setColor(const QColor &);
protected:
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *ev);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
signals:
void itemClickedSignal(const QColor &);
private:
bool m_bMouseIn;
QColor m_color;
private:
};
#endif // BASICCOLORITEM_H