New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS crashes when QgsRendererV2.symbolForFeature() is called from Python #18564
Comments
Author Name: Matthias Kuhn (@m-kuhn) As a workaround for the crash: embed your calls within In the long term it would however be nice to have somebody who knows this code to have a look at the lifetime of the expression which crashes. |
Author Name: Minoru Akagi (@minorua) Matthias Kuhn wrote:
Works fine with the workaround. Thanks, Matthias! |
Author Name: Jürgen Fischer (@jef-n) Fixed in changeset "dcc9d39a273eebc54f996af088daca23b31c0efb".
|
Author Name: Alexander Bruy (@alexbruy) Still true in latest master. Seems this method does not work as expected for almost all renderers:
Tested with point shapefile and same code as in initial post.
|
Author Name: Matthias Kuhn (@m-kuhn) I think the workaround should be accepted as solution and stated in the API documentation according to [1] The only thing left to fix is the crash in graduatedsymbolrenderer. The last "fix" was also just about the crash and not about changing the behavior to be compatible with calls out of startRender() / stopRender() context. [1] http://permalink.gmane.org/gmane.comp.gis.qgis.devel/32841
|
Author Name: Matthias Kuhn (@m-kuhn) No crash here.
|
Author Name: Minoru Akagi (@minorua)
Original Redmine Issue: 10096
Affected QGIS version: master
With graduated styled layer, the following code crashes QGIS. It works in 2.2 without any problems.
With categorized styled layer, symbolForFeature() returns None. It returns a subclass object of QgsSymbolV2 correctly in 2.2.
Crash doesn't seem to occur if the graduated styled layer has been loaded through a project file, and a subclass object of QgsSymbolV2 is returned correctly, but with categorized styled layer, it still returns None.
This method is useful for plugins which export data with styles.
The text was updated successfully, but these errors were encountered: