Feature request #6655
topoviewer: use QgsMapCanvasLayer to load layers with visibility=off
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||15832|
When loading big topologies qgis still renders the layers as first thing, before we get a chance of setting visibility off.
This means you can enter the "PAL loop of death" (that is a situation in which labelling kill your CPU).
The PAL issue is not available at the moment (or I can't find it).
But I swear it's there (qgis still hasn't finished loading the project I asked it to open at least 2 minutes before I started writing this ticket)
#1 Updated by Giuseppe Sucameli about 9 years ago
How many layers do you load at the same time?
If more than one, consider to set the render flag to false before loading layers using
iface.mapCanvas().setRenderFlag(False)and then restore it when the process ends.
After loading each layer you can set it as invisible using
#3 Updated by Sandro Santilli about 9 years ago
Ok one problem was that I did use the setVisibleFlag before adding to legend (for some layers).
This I'm going to fix right now.
But still I'll want to look at NatanW suggestion:
22:41 < NathanW> strk: you wrap it in a QgsMapCanvasLayer and set the visable flag
22:42 < NathanW> QgsMapCanvas take a list of QgsMapCanvasLayer in it's setLayerSet method
PAL is still killing me, but only when I click on the visibility checkbox :/
See #6656 for that one