PDA

View Full Version : Different behaviors of GLWidget,Widget,Canvas,Scene when obscured by other windows



yektaayduk
3rd October 2007, 11:50
Hello,

I tried different scenarios and here are the observations.

case-1: QT3.3.. Application has a Widget which has an openGLWidget , LineEdits and Buttons in its layout.
Part of the drawing is changing every 150 msec.

case-2: QT3.3.. Another Widget is created for zoomed view (but not added to the layout of the MainWidget).
I draw on this Widget in this way: Timer=>repaint=>paintEvent

case-3:QT3.3 ... Another Widget is created for zoomed view which has Canvas and Canvasview.
OCanvasPolygonItem is added to the Canvas.
I draw on this widget in this way Timer->canvas_update()=>update()=>drawShape of Item

case-4:QT 4.23..Another Widget is created for zoomed view which has Scene and Sceneview .
QGraphicItem is added to the Scene.
I draw on this widget in this way Timer->scene_update()=>update()=>paint of Item

When the openGLWidget in case-1 obscured by another window and uncovered again without any erased area.
The erased area repaired somehow without acccessing my drawing functions.

When the ZoomWidget in case-2 obscured by another window and uncovered again erased area appears.
System calls my PaintEvent function but I have nothing for recovery.

When the CanvasWidget in case-3 obscured by another window and uncovered again erased area appears.

When the SceneWidget in case-4 obscured by another window and uncovered again ,
erased area appears and don't call my paint function.



Has someone an explanation for these behaviors? Can You suggest a better way?

Thanks.

wysota
3rd October 2007, 12:04
but what exactly is the problem?

yektaayduk
3rd October 2007, 13:41
The problem is: I cant update the Zoom window entirely at once ,because it takes too long ,
other threads which requesting data from an signal processing board(actually from the kernel module of the same board kernel buffer overflows before I read it) and forwarding data via ethernet loosing data .
That's way I update the zoom window in time ,in small parts.Refreshing an erased part of the window obscured by another window, by my functions will take again too long.I need a solution without my effort,like i observed in opengl case (it recovers without calling my code ).Is this unique to opengl?

wysota
3rd October 2007, 13:47
This is an X11 issue. I think that using extensions such as Damage, you could avoid redraws, but I'm not sure of that. I suggest you cache the result of the last draw in a pixmap and simply redraw the pixmap when the paint event comes in. Just make sure to regenerate the pixmap when the contents of the widget change.

yektaayduk
4th October 2007, 08:03
Thank You wysota

I will try .