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. using QOpenGLWidget as viewPort for QGraphicsView in Scene doesn't work?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 543 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    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
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #2

      does anybody have any clue here?

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

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #4

          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
          0
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #5

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

            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