Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] Surface video is not clean at all (QGraphicsScene/QGraphicsVideoItem/QGraphicsView)



  • Hello,
    so, I'm having problem of rubbish pieces of surface where is not shown video.
    My code looks like this:
    @
    QGraphicsScene *scene = new QGraphicsScene(this);

    videoItem = new QGraphicsVideoItem;
    _graphicsView = new QGraphicsView(scene);
    _graphicsView->setViewport(new QGLWidget);
    scene->addItem(videoItem);
    ...
    _graphicsView->fitInView(videoItem, Qt::KeepAspectRatio);
    @

    Video is shown correctly, but rubbish pixels (pieces of other apps) are shown outside video's aspectratio.

    How can I clean all surface and not just where video takes place?



  • Ok, I found the correct way and post it to help someone in the future:
    @
    ((QGLWidget*)_graphicsView->viewport())->updateGL();
    @

    This call clean the opengl surface at all.


Log in to reply