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. QOpenGLWidget::update() stops working after a while
QtWS25 Last Chance

QOpenGLWidget::update() stops working after a while

Scheduled Pinned Locked Moved Solved General and Desktop
qopenglwidgetqt 5.14opengl
4 Posts 2 Posters 1.3k 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.
  • U Offline
    U Offline
    Ulysse
    wrote on 8 Jul 2020, 11:15 last edited by Ulysse 7 Aug 2020, 15:36
    #1

    Hi

    I have an application that uses a QOpenGLWidget to draw a scene contained in framebuffer wich is previously rendered offscreen in another thread.

    When the scene has finished rendering, the rendering thread signals the main thread to update the QOpenGLWidget.

    My problem is that sometimes, the widget stops from being repainted (and never comes back to normal behavior)
    The update function continues to be called regularly
    The paintGL function is not called anymore
    However, resizing the main window (that contains the widget) triggers a repaint, and draw the scene just the way it should

    Do you have any idea of what could cause this problem ?
    There is no warning log of any kind when the update problem starts to occur

    How could i debug this ?

    Regards
    Adrien

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Jul 2020, 21:24 last edited by
      #2

      Hi,

      Can you share your code ?

      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
      • U Offline
        U Offline
        Ulysse
        wrote on 9 Jul 2020, 08:40 last edited by
        #3

        Hi,

        I am afraid i can't, I don't have the right to and it comes along with some elements of the system that would make the 'snippet' too large to be concise
        However there's a mistake in my post : the rendering thread does not signal the QOpenGLWidget to update() itself, it directly calls update() on it instead.
        This may cause a problem if update() is not thread safe as i thought it was. Is it ?

        Should I send a signal in order to call update() in the main thread ? Or repaint() ? Although the latter does not seem to be a good idea as i need the drawing to be as smooth as possible

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Jul 2020, 11:51 last edited by
          #4

          You should not call GUI function from a different thread. Signal and slots is the way to go.

          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
          2

          2/4

          8 Jul 2020, 21:24

          • Login

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