Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved using QOpenGLWidget as viewPort for QGraphicsView in Scene doesn't work?

    General and Desktop
    2
    5
    222
    Loading More Posts
    • 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.
    • D
      davecotter last edited by davecotter

      on mac, using the recommended method of installing an OpenGL widget into the QGraphicsView doesn't seem to work.

      eg: open the default example code "Video Graphics Item", then at the top of VideoPlayer::VideoPlayer, add this code:

      graphicsView->setViewport(new QOpenGLWidget());
      

      when you run and open an HD h.264 movie and play it, you get no video, and a zillion of these in the log:

      Failed to activate video surface
      QOpenGLFunctions created with non-current context
      QPainterVideoSurface: Vertex shader compile error
      

      happens regardless of whether i set the default surface format before startup.

      1 Reply Last reply Reply Quote 0
      • D
        davecotter last edited by

        does anybody have any clue here?

        i'm following the documentation but the doc is apparently wrong :(

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          IIRC, the QGraphicsVideoItem already uses OpenGL to do its job so I'd take a look at context sharing. I can't guarantee it will work but it's worth a try.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply Reply Quote 0
          • D
            davecotter last edited by

            I have already tried that, to no avail. It's unrelated since this is all in the same window anyway.

            My question is why does following the method explicitly recommended by the canonical documentation cause errors?

            1 Reply Last reply Reply Quote 0
            • D
              davecotter last edited by

              if you think this bug is important, please vote for it

              1 Reply Last reply Reply Quote 0
              • First post
                Last post