kiranraj
18th June 2007, 15:14
Hi ,
I have a problem with freezing the display....
Problem is similar to this model.
step 1. I need to create and display thousands of rectangles. ( QGraphicsItem)
step 2. Do some calculation and Create lines ( by default hidden ) b/w the rectangles. ( millions of lines)
Here lines and rects are QGraphicsItems
Creation and display of rectangles is fast but creation of lines is taking too much time.
So iam planning to multithread the application, by executing the creation of lines in seperate thread to prevent freezing the display.
After displaying the Rectangles. The user should be able to do Zoom In, Zoomout, Panning.
While the background thread is ceating the lines.
My problem is ....
1. Is it possible to do this ? since Both the threads will be accessing the same GraphicsScene.
Main thread will be reading other thread will be adding line items to it.
2. Is there any way to synchronize both the threads ?
3. Is there any other solution?
Thanks...
I have a problem with freezing the display....
Problem is similar to this model.
step 1. I need to create and display thousands of rectangles. ( QGraphicsItem)
step 2. Do some calculation and Create lines ( by default hidden ) b/w the rectangles. ( millions of lines)
Here lines and rects are QGraphicsItems
Creation and display of rectangles is fast but creation of lines is taking too much time.
So iam planning to multithread the application, by executing the creation of lines in seperate thread to prevent freezing the display.
After displaying the Rectangles. The user should be able to do Zoom In, Zoomout, Panning.
While the background thread is ceating the lines.
My problem is ....
1. Is it possible to do this ? since Both the threads will be accessing the same GraphicsScene.
Main thread will be reading other thread will be adding line items to it.
2. Is there any way to synchronize both the threads ?
3. Is there any other solution?
Thanks...