mirror of
https://github.com/RustyRaptor/learnopencv.git
synced 2026-12-03 22:15:16 -07:00
16 lines
362 B
C++
16 lines
362 B
C++
#include "camviewer.h"
|
|
|
|
void CamViewer::setImage(QImage im)
|
|
{
|
|
image = im;
|
|
this->scene()->update();
|
|
|
|
}
|
|
|
|
void CamViewer::paintEvent(QPaintEvent* evnt)
|
|
{
|
|
QPainter painter(viewport());
|
|
painter.drawImage(QRect(0,0,viewport()->width(),viewport()->height()), image, QRect(0,0, image.width(), image.height()) );
|
|
QGraphicsView::paintEvent(evnt);
|
|
}
|