Bug report #13973

Crash when switching from custom renderer to another

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

Status:Closed Start Date:12/10/2015
Priority:High Due date:
Assigned to:Martin Dobias % Done:

0%

Category:Python plugins and bindings
Target version:Future Release - High Priority
Platform:all Pull Request or Patch supplied:No
Platform version: Affected version:master
Status info: Causes crash or corruption:Yes
Resolution:invalid Tag:

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.1 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 492c1a9ff024fbd564b81d288fcd779cd493ee4e
Added by Martin Dobias about 1 year ago

Improve documentation for renderer registry metadata (refs #13973)

History

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

Updated by Alexander Bruy over 1 year ago

  • File deleted (renderertest.tar.bz2)

Updated by Alexander Bruy about 1 year ago

  • Assigned to set to Martin Dobias

Updated by Martin Dobias about 1 year ago

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

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