1 #ifndef IMAGEWIDGET_H 2 #define IMAGEWIDGET_H 3 4 #include <QWidget> 5 6 class ImageWidget : public QWidget 7 { 8 Q_OBJECT 9 public: 10 bool bFit; 11 12 public: 13 ImageWidget(QWidget *parent = 0); 14 void setPixmap(QString fileName); 15 void setPixmap(QByteArray& bytes); 16 void setPixmap(const uchar* buf); 17 18 19 protected: 20 void paintEvent(QPaintEvent *event); 21 22 private: 23 QPixmap pixmap; 24 QImage* qImage; 25 uchar buffer[320*240*2]; 26 27 }; 28 29 #endif // IMAGEWIDGET_H 30