QGraphicsVideoItem doesn't render QCamera output, while QCameraViewfinder does without problems
-
As the title says, I need to use a
QGraphicsSceneto render points (ellipses) on top of theQCameraoutput.
So what I've done? I've created a scene, added aQGraphicsVideoItemand setted that item as theQCameraviewfinder.
The problem is that it never renders the camera output.
I tested with aQCameraViefinderand worked flawlessly, on the first try.
The strange thing is that I've did it in the past, so I don't understand what kind of setup theQGraphicsVideoItemrequires.Do I need to set the item as the viewfinder before it's added to the scene?
Do I need to be sure it's painted at least once before setting it as the viewfinder?At the moment I'm simply doing this:
void worker::set_viewfinder(QGraphicsVideoItem *video_item) // doesn't work { camera->stop(); camera->setViewfinder(video_item); camera->start(); } void worker::set_viewfinder(QVideoWidget *video_item) // works { camera->stop(); camera->setViewfinder(video_item); camera->start(); } -
Hi,
Which version of Qt are you using ?
On which platform ?
The class name Worker suggests it could be doing things in a different thread, is it the case ?
Do you have the same issue with a simple view, scene and item ?