Overlay Qpaint on Camera example
Unsolved
General and Desktop
-
I want to overlay two rectangles on top of the video stream from the camera example project.
void Camera::paintEvent(QPaintEvent * /*event*/) { QPainter p{this}; p.setPen(Qt::blue); p.drawRect(QRect(500,40,260,140)); p.drawRect(QRect(700,0,150,150)); }
Right now this code successfully paints two rectangles, the only issue is it does not overlay on top of the video stream and it is behind it. How would i get it to be the top layer on the GUI so it overlaps the video stream.
-
Hi,
Are you doing any image processing ?
Depending on what you want to do, you may have to use a custom QAbstractVideoSurface to modify the video frame before showing it.
A QVideoFilterRunnable might also be a solution but I think it requires QtQuick for the GUI.