Bug report #5170

qgsrendererv2propsdialogbase.ui

Added by Marco Bernasocchi almost 3 years ago. Updated about 1 year ago.

Status:Closed Start Date:03/12/2012
Priority:Blocker Due date:
Assigned to:- % Done:

0%

Category:-
Target version:-
Must fix: Resolution:
Platform: Patch supplied:No
Platform version: Tag:

Description

qgsrendererv2propsdialogbase.ui is shown when new vector symbology is activated.
"this renderer doesn't implement a graphical interface" is shown instead of options availables and the rendering is not correct.
Choosing old symbology fixes all problems

qgisANDROID.png - shp file using V2 symbology on android (183.6 kB) Marco Bernasocchi, 03/12/2012 01:55 pm

qgisDESKTOP.png - shp file using V2 symbology on linux (67.8 kB) Marco Bernasocchi, 03/12/2012 01:55 pm

P20120312231653.png - Options dialog (85.7 kB) Marco Bernasocchi, 03/12/2012 03:21 pm


Related issues

related to QGIS Application - Bug report #8646: Python QgsRendererV2Widget not displaying on Windows 64 b... Reopened 09/22/2013

History

Updated by Marco Bernasocchi almost 3 years ago

Updated by Marco Bernasocchi about 1 year ago

  • Status changed from Open to In Progress
  • Priority changed from Normal to Blocker

the problem is that in qgsrendererv2propertiesdialog.cpp

static bool _initRenderer( QString name, QgsRendererV2WidgetFunc f, QString iconName = QString() )
{
  QgsRendererV2Registry* reg = QgsRendererV2Registry::instance();
  QgsRendererV2AbstractMetadata* am = reg->rendererMetadata( name );
  if ( am == NULL )
    return false;
  QgsRendererV2Metadata* m = dynamic_cast<QgsRendererV2Metadata*>( am );
  if ( m == NULL )
    return false;

the second cast returns m = null

see: https://gist.github.com/mbernasocchi/6719111

Updated by Marco Bernasocchi about 1 year ago

adding the same cast in QgsRendererV2Registry::addRenderer( QgsRendererV2AbstractMetadata* metadata ) results in a not NULL object

Updated by Marco Bernasocchi about 1 year ago

  • Status changed from In Progress to Feedback

changing the cast to static_cast fixes the problem. Waiting for Jef's comments

Updated by Luigi Pirelli about 1 year ago

Marco Bernasocchi wrote:

changing the cast to static_cast fixes the problem. Waiting for Jef's comments

did you implemented:

virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) = 0;

in am class? dynamic_cas saing you something is incomplete in am implementation

Updated by Marco Bernasocchi about 1 year ago

gino in qgsrendererv2registry.h where this is defined:

class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata

there is
virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { return mCreateFunc ? mCreateFunc( elem ) : NULL; }

Updated by Marco Bernasocchi about 1 year ago

Final fix is to add QgsRendererV2Metadata::~QgsRendererV2Metadata(){} in qgsrendererv2registry.cpp and ~QgsRendererV2Metadata(); in qgsrendererv2registry.h

Updated by Marco Bernasocchi about 1 year ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF