qt/LedOK/ColorDialog/PreviewColorArea.h

39 lines
652 B
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
// 颜色预览区域
#ifndef PREVIEWCOLORAREA_H
#define PREVIEWCOLORAREA_H
#include <QWidget>
class PreviewColorArea : public QWidget
{
Q_OBJECT
public:
PreviewColorArea(QWidget *parent);
~PreviewColorArea();
void setCurColor(const QColor &);
void setNewColor(const QColor &);
QColor getNewColor(){ return m_newColor;}
protected:
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
private:
void paint(QPainter &painter, QRect) const;
public slots:
void svChangedSlot(int, int, int);
signals:
void svChangedSignal(int, int, int);
private:
QColor m_curColor;
QColor m_newColor;
};
#endif // PREVIEWCOLORAREA_H