Skip to content

Commit

Permalink
Fix subclassing of QgsDiagramRenderer in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 22, 2017
1 parent 78a990b commit e6863be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/core/qgsdiagramrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
12 changes: 12 additions & 0 deletions src/core/qgsdiagramrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e6863be

Please sign in to comment.