#ifndef _MY_PAINT_WIDGET_HH_ #define _MY_PAINT_WIDGET_HH_ #include class QMouseEvent; class QPixmap; class QImage; class QPaintEvent; #define SLOW class MyPaintWidget: public QLabel { Q_OBJECT public: MyPaintWidget(); int loadImage(const char* filename); public slots: void clearPainting(void); void setPenColor(QColor color); protected: int old_x; int old_y; void mousePressEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); void paintEvent(QPaintEvent *e); private: QColor _pen_color; QPixmap *_image; #ifdef SLOW QImage *_painting; #else QPixmap *_painting; #endif }; #endif