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. Transitioning from QGLWidget to QOpenGLWidget issue.
Forum Updated to NodeBB v4.3 + New Features

Transitioning from QGLWidget to QOpenGLWidget issue.

Scheduled Pinned Locked Moved Unsolved General and Desktop
opengl
6 Posts 2 Posters 106 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
    DalePennington
    wrote last edited by
    #1

    Folks,

    We have updated a long running code base from QGLWidget to QOpenGLWidget, but we had some issues.

    We open dialogs over the widget then close them again, the widget is not repainting where the dialog was.

    Not looking at the code, I see we set to attributes: Qt::WA_PaintOnScreen and Qt::WA_NoSystemBackground. I suspect the Qt:WA_PaintOnScreen is part of the issue, but am not sure if it or the Qt::WA_NoSystemBackground actually are the problem.

    Anyone have more info.

    Dale

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DalePennington
      wrote last edited by
      #2

      I have some additional information on the QOpenGLWidget side of things. When using QGLWidget, I see repaintEvents coming to the parent window, but when using QOpenGLWidget I do not see them, even when doing the same sequence of events. Not sure what that means, but it explains the lack of repaints.

      Dale

      jsulmJ 1 Reply Last reply
      0
      • D DalePennington

        I have some additional information on the QOpenGLWidget side of things. When using QGLWidget, I see repaintEvents coming to the parent window, but when using QOpenGLWidget I do not see them, even when doing the same sequence of events. Not sure what that means, but it explains the lack of repaints.

        Dale

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote last edited by jsulm
        #3

        @DalePennington Did you implement https://doc.qt.io/qt-6/qopenglwidget.html#paintGL ?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DalePennington
          wrote last edited by
          #4

          The existing code (using QGLWidget) does not implement the paintGL function. This GL painting is handled internally by a third party library. I just replaces the QGLWidget with QOpenGLWidget, not other changes.

          At this point I think the big issue is lack of repaintEvents. Is that somehow tied to the paintGL function ?

          Dale

          jsulmJ 1 Reply Last reply
          0
          • D DalePennington

            The existing code (using QGLWidget) does not implement the paintGL function. This GL painting is handled internally by a third party library. I just replaces the QGLWidget with QOpenGLWidget, not other changes.

            At this point I think the big issue is lack of repaintEvents. Is that somehow tied to the paintGL function ?

            Dale

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote last edited by
            #5

            @DalePennington said in Transitioning from QGLWidget to QOpenGLWidget issue.:

            Is that somehow tied to the paintGL function ?

            Yes, this is what you need to do if you want to use QOpenGLWidget - implement paintGL

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DalePennington
              wrote last edited by
              #6

              I have gotten a new sample from the library vendor, and it does use paintGL. We were working off a sample from 12 years ago as our base and apparently they have updated a lot since then. I am trying to fit their new implementation in and see how it works.

              Thanks for the feedback

              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