Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Strong Flickering in QGLWidget as viewport
Qt 6.11 is out! See what's new in the release blog

Strong Flickering in QGLWidget as viewport

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I use Qt Gstreamer to push video streams into Qt.
    I build program that used 2 'videotestsrc' gstreamer elements and render it into QDeclarativeView. I used for it 2 QGst::Ui::GraphicsVideoSurface's, each surface for each stream. I bind these surfaces with created QDeclarativeView. In qml file I create 2 VideoItem's to render 2 streams.
    The program works perfectly. But if I use QGLWidget as viewport of QDeclarativeView, there is very strong flickering. With QWidget as viewport there is no such effect.
    What I remarked, the problem is that QGLWidget rerender background every time before VideoItem will be rerendered. If place Rectangle beside with VideoItem, it won't be visible.
    I have tried change various properties, but this is not solve my problem.
    I have tried change view attributes as below:
    @
    view.setAttribute(Qt::WA_NoSystemBackground, true);
    view.setAttribute(Qt::WA_OpaquePaintEvent, true);
    @

    I have tried change view.viewport() attributes as below:
    @
    view.viewport()->setAttribute(Qt::WA_NoSystemBackground, true);
    view.viewport()->setAttribute(Qt::WA_OpaquePaintEvent, true);
    @

    I have tried to change every Qml Rectangle Element to Qml Item Element. Now in .qml file there are only Items and VideoItems. It just little weaken flickering, but flickering is still strong.

    So stupid situation. The problem has solved by set
    @
    view.viewport()->setAutoFillBackground(false);
    @

    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