Skip to content
Permalink
Browse files
Fix sip subclassing for properties
  • Loading branch information
nyalldawson committed Jan 23, 2017
1 parent 53ba1a1 commit ef3f61fc1776bf46a9520620384a32daddc0e2fc
Showing with 13 additions and 3 deletions.
  1. +3 −3 python/core/qgsproperty.sip
  2. +10 −0 python/core/qgspropertycollection.sip
@@ -15,11 +15,11 @@ class QgsAbstractProperty
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsStaticProperty*>(sipCpp) != NULL)
if ( sipCpp->propertyType() == QgsAbstractProperty::StaticProperty )
sipType = sipType_QgsStaticProperty;
else if (dynamic_cast<QgsFieldBasedProperty*>(sipCpp) != NULL)
else if ( sipCpp->propertyType() == QgsAbstractProperty::FieldBasedProperty )
sipType = sipType_QgsFieldBasedProperty;
else if (dynamic_cast<QgsExpressionBasedProperty*>(sipCpp) != NULL)
else if ( sipCpp->propertyType() == QgsAbstractProperty::ExpressionBasedProperty )
sipType = sipType_QgsExpressionBasedProperty;
else
sipType = sipType_QgsAbstractProperty;
@@ -10,6 +10,16 @@ class QgsAbstractPropertyCollection
%TypeHeaderCode
#include <qgspropertycollection.h>
%End

%ConvertToSubClassCode
if ( dynamic_cast<QgsPropertyCollection*>(sipCpp) )
sipType = sipType_QgsPropertyCollection;
else if ( dynamic_cast<QgsPropertyCollectionStack*>(sipCpp) )
sipType = sipType_QgsPropertyCollectionStack;
else
sipType = sipType_QgsAbstractPropertyCollection;
%End

public:

QgsAbstractPropertyCollection( const QString& name = QString() );

0 comments on commit ef3f61f

Please sign in to comment.