QOpenGLWidget::update() stops working after a while
-
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 shouldDo you have any idea of what could cause this problem ?
There is no warning log of any kind when the update problem starts to occurHow could i debug this ?
Regards
Adrien -
Hi,
Can you share your code ?
-
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 theQOpenGLWidget
toupdate()
itself, it directly callsupdate()
on it instead.
This may cause a problem ifupdate()
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 ? Orrepaint()
? Although the latter does not seem to be a good idea as i need the drawing to be as smooth as possible -
You should not call GUI function from a different thread. Signal and slots is the way to go.