QgsMapCanvas not rendering raster layers in QGIS 1.7 #13480
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Map and Legend
Related to map or legend rendering
Milestone
Author Name: goocreations - (goocreations -)
Original Redmine Issue: 3420
Redmine category:map_canvas
Assignee: Martin Dobias
I've found a problem when using the [[QgsMapCanvas]] in new version of QGIS(1.7) which is not present in the previous version.
When using [[QgsMapCanvas]] in Python like this:
The debug console says the raster was render without issues, the extent was set correctly, but the raster is not showing on the canvas (MirrorMap python plugin has the problem too).
After working through the C++ source code of [[QgsMapCanvas]], I've noticed that most of the resizeEvent's code is now in the paintEvent. For some reason repaint is not called once the canvas resizes, hence the code (previously in the resiveEvent) is never executed. The important part of the code is:
which when called renders the raster correctly. I've adapted the python code of my plug-in as follows:
Every time I add a raster layer to the canvas, I have to manually resize the map of the canvas.
I'm not sure if this is a bug, or if it has to be this way. Is there any other or better way doing this?
The text was updated successfully, but these errors were encountered: