#ifndef COLOR_BOX_H #define COLOR_BOX_H #include class ColorBox: public QFrame { Q_OBJECT public: ColorBox( QColor aColor = Qt::white ); QColor color() const { return m_color; } void setColor( QColor aColor ); protected: void mousePressEvent ( QMouseEvent* event ); void changeEvent ( QEvent* event ); signals: void colorChanged( QColor aColor ); private: static const int MinHeight = 25; static const int MinWidth = 50; QColor m_color; }; #endif