[Qgis-user] different behaviour if plugin is loaded on startup or in plugin manager
Möri Cedric
Cedric.Moeri at bd.so.ch
Tue Apr 7 07:44:32 PDT 2009
Hi list
in try to 'autoload' a layer with my plugin, i.e. the layer should appear at the time, the plugin is loaded. So I added a load layer funciton in initGui().
If the plugin is activated in the plugin manager, everythings works fine and my layer shows up.
If the plugin is already activated at the qgis startup, the layer doesn't show. There is a warning about QPainter not activated at the startup:
Warning: QPainter::begin: Cannot paint on a null pixmap
Warning: QPainter::setRenderHint: Painter must be active to set rendering hints
Warning: QPainter::end: Painter not active, aborted
So I guess, the plugins are loaded at a time, where not everything needed is already 'there'.
In fact the behaviour of the initGui() isn't the same if loaded during a session or at startup.
Is there a way to have the layer also shown if the plugin is activated already at startup?
Or more general: What to do, that initGui() does the same in both cases?
kind regards
Cédric
mit freundlichen Grüssen
Cédric Möri
GIS-Informatiker
--
Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
Rötistrasse 4
4501 Solothurn
Telefon: +41 (0)32 627 24 75
Telefax: +41 (0)32 627 22 14
mailto:cedric.moeri at bd.so.ch
http://www.agi.so.ch
More information about the Qgis-user
mailing list