-
Notifications
You must be signed in to change notification settings - Fork 0
/
cvwidget.h
47 lines (32 loc) · 873 Bytes
/
cvwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef CVWIDGET_H
#define CVWIDGET_H
// Qt header files
#include <QWidget>
#include <QPixmap>
#include <QDebug>
#include <QtGui>
// OpenCV header files
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
QImage MatToQImage(const Mat&);
class CVWidget : public QWidget
{
Q_OBJECT
public:
explicit CVWidget(QWidget *parent = 0);
void setPixmap(QPixmap _pixmap) { pixmap = _pixmap; emit pixmapChanged(); update(); }
QPixmap getPixmap() { return pixmap; }
void paintEvent(QPaintEvent *);
void mousePressEvent (QMouseEvent * event);
void wheelEvent(QWheelEvent * event);
// void keyPressEvent(QKeyEvent *);
// QDragLeaveEvent Enter, dragMoveEvent (QWidget)
// mouseDoubleClickEvent
private:
QPixmap pixmap;
signals:
void pixmapChanged();
public slots:
};
#endif // CVWIDGET_H