Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Surface video is not clean at all (QGraphicsScene/QGraphicsVideoItem/QGraphicsView)
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlterX
    wrote on last edited by
    #1

    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?

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AlterX
      wrote on last edited by
      #2

      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.

      Qt Ambassador
      Real-time cooperative teams: http://www.softairrealfight.net
      Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

      https://codereview.qt-project.org/...

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved