[Qgis-developer] WMS Design Problem and Mac Crash
Tom Elwertowski
telwertowski at comcast.net
Sat Feb 10 21:11:29 EST 2007
Hi all,
I'd like to fix a Mac crash and some redraw problems which involve a
change extending through several layers of QGIS so I am putting this out
for review before proceeding. The redraw problem can be seen using a WMS
layer when resizing the window and sometimes when zooming. Only 0.8
crashes but the redraw issues are the same in 0.8 and 0.9.
The WMS provider calls processEvents to fetch a remote image while
inside a draw event. processEvents is needed to receive the network
event containing the retrieved image, however, calling processEvents
during a draw event on a Mac can result in incorrect drawing or a crash.
The problem occurs because processEvents may process other draw events
while waiting for the remote image and, at least on a Mac, draw events
cannot be interrupted by other draw events.
To a lesser extent, odd redraw artifacts also remain in Ubuntu after
resizing a WMS layer.
One fix is to add a loadImage routine to the provider so that the canvas
can notify all layers about what is needed beforehand and not call
QPainter::begin until all images are locally available.
For local layers, loadImage does nothing. For remote layers, loadImage
initiates a transfer if the cache is invalid. The canvas then needs to
wait until all layers signal ready.
Tom
More information about the Qgis-developer
mailing list