Skip to content
Permalink
Browse files

Fix subclassing of QgsDiagramRenderer in Python

  • Loading branch information
wonder-sk committed Jun 22, 2017
1 parent 78a990b commit e6863be68e100c68b215009e513b436477907564
Showing with 21 additions and 0 deletions.
  1. +9 −0 python/core/qgsdiagramrenderer.sip
  2. +12 −0 src/core/qgsdiagramrenderer.h
@@ -450,6 +450,15 @@ class QgsDiagramRenderer

%TypeHeaderCode
#include "qgsdiagramrenderer.h"
%End

%ConvertToSubClassCode
if ( sipCpp->rendererName() == QStringLiteral( "SingleCategory" ) )
sipType = sipType_QgsSingleCategoryDiagramRenderer;
else if ( sipCpp->rendererName() == QStringLiteral( "LinearlyInterpolated" ) )
sipType = sipType_QgsLinearlyInterpolatedDiagramRenderer;
else
sipType = NULL;
%End
public:

@@ -485,6 +485,18 @@ class CORE_EXPORT QgsDiagramInterpolationSettings

class CORE_EXPORT QgsDiagramRenderer
{

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( sipCpp->rendererName() == QStringLiteral( "SingleCategory" ) )
sipType = sipType_QgsSingleCategoryDiagramRenderer;
else if ( sipCpp->rendererName() == QStringLiteral( "LinearlyInterpolated" ) )
sipType = sipType_QgsLinearlyInterpolatedDiagramRenderer;
else
sipType = NULL;
SIP_END
#endif

public:

QgsDiagramRenderer();

0 comments on commit e6863be

Please sign in to comment.
You can’t perform that action at this time.