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. Upgraded to 4.8.5, now have GL redraw issues
Qt 6.11 is out! See what's new in the release blog

Upgraded to 4.8.5, now have GL redraw issues

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.8k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I'm using Qt 4.8.5 on a big project. I just upgraded from 4.7.2.

    Since upgrading I have a problem, on OSX only. I have two dockable windows in a layout. Window A has a vertical scrollbar, and window B is a QGLWidget.

    In 4.7.2, if I scrolled the scrollbar in A, only A received paintEvents as you would expect.

    However, since upgrading to 4.8.5, both A and B get paintEvents. This causes the GLWidget to paint incompletely at time. I have to click on the GLWidget (forcing a new paintEvent) to get window B to redraw properly.

    If I cause paint events in window B, they are not occurring in window A. Only from A to B.

    Debugging paint events is hard. Can anyone give me any help?

    Thanks

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

      Hi,

      This might be a regression, did you check the "bug report system":http://bugreports.qt-project.org/issues to see if it's something known ?

      If not, can you create a minimal compilable application that allows to reproduce the problem and create a new report with it ?

      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
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        I did check, yes. I found one but its for 5.1!

        https://bugreports.qt-project.org/browse/QTBUG-30655

        The workaround they describe does not work in my case.

        I've not been able to produce a simple repro case yet.

        I forgot to say that the problem is solved if I dock the two windows together then move back to original position.

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

          Then the best way is to start with your current software and remove piece by piece everything until you have the minimal case

          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
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            So does this sound like a Qt bug? I found a fix for my problem.

            Initially I found a runtime fix. I have the two widgets, A (containing a QScrollArea) and B (a QGLWidget). They both have a common QSplitter as ancestor.

            If the scroll area in A was bigger than the containing widget, the paint events 'spilled' out. Paint events from A made B draw badly, until B got a paint event to correct the mess.

            If I docked the two widgets, then restored position, the problem was fixed. So why was this?

            When a QWidget calls setGeometry, setWSGeometry is called. This calculates the dirty rect and tries to inform the 'native parent' using QWidget::nativeParentWidget::update(QRect).

            A native parent is not the same as a parent. Its the closest ancestor with a system ID. See:

            http://qt-project.org/doc/qt-4.8/qwidget.html#nativeParentWidget

            Note this does not need to be the MainWindow.

            Since the upgrade to Qt 4.8, the initial state of nativeWidgets in my app is different.

            Dirty rects from widget A's QScrollArea are sent directly to the QSplitter, 'spilling' into widget B. They should be clipped by the parent, widget A itself. But widget A is not a nativeWidget!

            The act of moving either A or B to make them siblings changes this. Now widget A has become a nativeWidget. Only by making them siblings does this occur.

            My theory is that widget B, being a QGLWidget, is a native widget. Qt doesn't ordinarily seem to allow native and non-native siblings, so by making widgets A and B siblings, widget A is converted to a nativeWidget.

            The fix is to set the Qt::WA_NativeWindow attribute on widget A at initialisation.

            But why?

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

              IIRC, there was a switch to "alien widgets for Qt 4.8 on mac":http://blog.qt.digia.com/blog/2011/02/23/alien-widgets-on-mac/ so you might indeed have found a bug.

              Did you check the "bug report system":http://bugreports.qt-project.org to see whether it's something known ? If not you could consider opening a bug report with a minimal example and your findings to help fix this.

              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

              • Login

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