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. Problem using QGraphicsVideoItem with QOpenGLWidget
QtWS25 Last Chance

Problem using QGraphicsVideoItem with QOpenGLWidget

Scheduled Pinned Locked Moved Solved General and Desktop
openglmac osgraphcisviewqtquick
6 Posts 2 Posters 1.6k Views
  • 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.
  • I Offline
    I Offline
    Ilja
    wrote on last edited by
    #1

    Hi,

    I'm working on a QWidgets application that uses a QGraphicsView with, among other items, a QGraphicsVideoItem. Currently, we're using a QGLWidget as the viewport for the QGraphicsView.

    This works well, but we're now porting part of the application over to QtQuick. We'd like to do the port in steps, so preferable do not want to touch the QGraphicsView/video part yet. However, it seems that switching to the QGraphicsView and then back to the QtQuick UI (embedded using QWidget::createWindowContainer(QQuickView*, QWidget*) ) causes serious issues, as the QtQuick UI will not respond to mouse clicks anymore.

    We've been doing some experimenting, and found out that not using a QGLWidget as the viewport for the graphics view fixed this. However, when using a QOpenGLWidget as the viewport, the video is no longer shown. Only a light blue square.

    I'm probably missing something obvious or doing something silly. The change in the graphics view code is this:

    original code:

    auto * viewPortWidget = new QGLWidget(QGLFormat(QGL::SampleBuffers), this)
    

    new code:

    QSurfaceFormat format = QSurfaceFormat::defaultFormat();
    format.setDepthBufferSize(0);
    format.setSamples(4);
    auto* viewPortWidget = new QOpenGLWidget(this);
    viewPortWidget->setFormat(format);
    

    We'd like to find a solution for one of the two issues.

    1. Let QtQuick still take mouse clicks after using the graphics view,
    2. Use graphics view with QOpenGLWidget and QGraphicsVideoItem.

    By the way, were presenting QVideoFrame objects with QVideoFrame::Format_YUV420P format. We've checked that the videosurface supports the format.

    Another thing: This is on Mac OS X 10.13, with Qt 5.10.

    Example of what it looks like:

    alt text

    Thank you for taking the time to read this.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Looking nice
      I was wondering if you are .1 version away from fix.
      https://bugreports.qt.io/browse/QTBUG-53099

      I 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        Looking nice
        I was wondering if you are .1 version away from fix.
        https://bugreports.qt.io/browse/QTBUG-53099

        I Offline
        I Offline
        Ilja
        wrote on last edited by
        #3

        @mrjj You're right, we're on 5.10.0. We'll do the update to 5.10.1 (or 5.11) and send an update.

        mrjjM 1 Reply Last reply
        1
        • I Ilja

          @mrjj You're right, we're on 5.10.0. We'll do the update to 5.10.1 (or 5.11) and send an update.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Ilja
          I cross fingers it was just a bug and it it will just work in the later version :)

          I 1 Reply Last reply
          0
          • mrjjM mrjj

            @Ilja
            I cross fingers it was just a bug and it it will just work in the later version :)

            I Offline
            I Offline
            Ilja
            wrote on last edited by
            #5

            @mrjj Thanks a lot for your quick reply. Upgrading to 5.11 did the trick.

            mrjjM 1 Reply Last reply
            3
            • I Ilja

              @mrjj Thanks a lot for your quick reply. Upgrading to 5.11 did the trick.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @Ilja
              Super good to hear.
              Thank you for the feedback.
              happy programming.

              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