summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/video_widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_pt/video_widget.h')
-rw-r--r--ftnoir_tracker_pt/video_widget.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ftnoir_tracker_pt/video_widget.h b/ftnoir_tracker_pt/video_widget.h
index a68d8028..eb63a15e 100644
--- a/ftnoir_tracker_pt/video_widget.h
+++ b/ftnoir_tracker_pt/video_widget.h
@@ -16,20 +16,22 @@
#include <QMutexLocker>
#include <QLabel>
#include <QPainter>
+#include <QPaintEvent>
// ----------------------------------------------------------------------------
-class VideoWidget : public QLabel
+class VideoWidget : public QWidget
{
Q_OBJECT
public:
- VideoWidget(QWidget *parent) : QLabel(parent), mtx() {
+ VideoWidget(QWidget *parent) : QWidget(parent), mtx() {
}
void update_image(cv::Mat frame, std::auto_ptr< std::vector<cv::Vec2f> > points);
protected slots:
void paintEvent( QPaintEvent* e ) {
- setPixmap(pixmap);
- QLabel::paintEvent(e);
+ QMutexLocker((QMutex*)&mtx);
+ QPainter painter(this);
+ painter.drawPixmap(e->rect(), pixmap);
}
private: