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 29 Jun 2018, 17:15 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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 29 Jun 2018, 17:21 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 29 Jun 2018, 17:27
      3
      • M mrjj
        29 Jun 2018, 17:21

        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 29 Jun 2018, 17:27 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.

        M 1 Reply Last reply 29 Jun 2018, 17:29
        1
        • I Ilja
          29 Jun 2018, 17:27

          @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.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 29 Jun 2018, 17:29 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 29 Jun 2018, 19:54
          0
          • M mrjj
            29 Jun 2018, 17:29

            @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 29 Jun 2018, 19:54 last edited by
            #5

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

            M 1 Reply Last reply 29 Jun 2018, 20:06
            3
            • I Ilja
              29 Jun 2018, 19:54

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

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 29 Jun 2018, 20:06 last edited by mrjj
              #6

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

              1 Reply Last reply
              0

              1/6

              29 Jun 2018, 17:15

              • Login

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