Skip to content

Commit

Permalink
Fix sip subclassing for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 23, 2017
1 parent 53ba1a1 commit ef3f61f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/core/qgsproperty.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions python/core/qgspropertycollection.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down

0 comments on commit ef3f61f

Please sign in to comment.