Bug report #13973

Crash when switching from custom renderer to another

Added by Alexander Bruy over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:High
Assignee:Martin Dobias
Category:Python plugins and bindings
Affected QGIS version:master Regression?:No
Operating System:all Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:Yes

Description

Subject says it all. To reproduce:

  1. add custom renderer for vector layer (e.g. one from VectorFieldRenderer plugin or from attached example plugin)
  2. load point layer and select custom renderer for it from layer properties dialog
  3. apply changes and close layer properties dialog
  4. open layer properties dialog again and try to select standard renderer, e.g. Single Symbol
  5. QGIS crashes

renderertest.tar.bz2 (4.12 KB) Alexander Bruy, 12/22/2015 06:21 AM


Related issues

Related to QGIS Application - Bug report #14025: Crash when loading project with custom renderer for vecto... Closed 12/22/2015

Associated revisions

Revision 492c1a9f
Added by Martin Dobias over 1 year ago

Improve documentation for renderer registry metadata (refs #13973)

History

#1 Updated by Alexander Bruy over 1 year ago

Ok, I solved issue with crash when switching from custom renderer to standard. But there stll get Python error when switching

TypeError: invalid result type from MyTestRendererWidget.renderer()

I checked, MyTestRendererWidget.renderer() returns subclass of the QgsFeatureRendererV2, as required by API.

Test plugin updated

#2 Updated by Alexander Bruy over 1 year ago

  • File deleted (renderertest.tar.bz2)

#3 Updated by Alexander Bruy over 1 year ago

  • Assignee set to Martin Dobias

#4 Updated by Martin Dobias over 1 year ago

  • Resolution set to invalid
  • Status changed from Open to Closed

The main problem was that the old renderer was used as-is in the test renderer implementation, while it is just a temporary pointer. See the fixed implementation I have attached in #14025 (mytestrenderer.py).

Improved the documentation and closing as invalid...

Also available in: Atom PDF