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. Desperately need help porting to QOpenGLWidget and maintaining threaded rendering
Forum Updated to NodeBB v4.3 + New Features

Desperately need help porting to QOpenGLWidget and maintaining threaded rendering

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

    Hello there. We have a product that renders up to 3 images (raw data so we're using QImage) onto a surface. I had started with a proof of concept which ill attach (the real app is much more complicated but uses the same rendering code) and have the surface fully rendering in a separate thread from the UI. Between 4 developers over weeks we've not been able to successfully port this to QOpenGLWidget and maintain a separate rendering thread. It feels like something really subtle but easy, 1 line out of place or something.

    • Does anyone know how long until we loose QGLWidget?
    • Anyone know how to port the attached to QOpenGLWidget correctly? This is my working prototype using QGLWidget (based on hypnotizer)

    ThreadTest

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

      Hi,

      1. Not before Qt 6
      2. Did you check QOpenGLContext::supportsThreadedOpenGL ?

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

      W 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        1. Not before Qt 6
        2. Did you check QOpenGLContext::supportsThreadedOpenGL ?
        W Offline
        W Offline
        wesblake
        wrote on last edited by
        #3

        @SGaist Yes, I get back true. And the attached demo does work on the same machine.
        If I I simply flip everything over from QGLWidget to QOpenGLWidget (along with just a couple small changes since it's constructor is different), I get the following when I "start rendering"
        "Cannot make QOpenGLContext current in a different thread"
        If I press Ignore on the dialog, it starts to render anyways, but is sort of sporadic, hard to explain. If QOpenGLWidget is to be a replacement for QGLWidget, it should be capable of the same things at least, no?

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

          What OS are you on ?

          There might be some adjustment to do but yes, it should do the same.

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

          W 1 Reply Last reply
          0
          • SGaistS SGaist

            What OS are you on ?

            There might be some adjustment to do but yes, it should do the same.

            W Offline
            W Offline
            wesblake
            wrote on last edited by
            #5

            @SGaist Windows & Mac, the demo I attached works on both.

            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