Skip to content

Commit ef3f61f

Browse files
committedJan 23, 2017
Fix sip subclassing for properties
1 parent 53ba1a1 commit ef3f61f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
 

‎python/core/qgsproperty.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class QgsAbstractProperty
1515
%End
1616

1717
%ConvertToSubClassCode
18-
if (dynamic_cast<QgsStaticProperty*>(sipCpp) != NULL)
18+
if ( sipCpp->propertyType() == QgsAbstractProperty::StaticProperty )
1919
sipType = sipType_QgsStaticProperty;
20-
else if (dynamic_cast<QgsFieldBasedProperty*>(sipCpp) != NULL)
20+
else if ( sipCpp->propertyType() == QgsAbstractProperty::FieldBasedProperty )
2121
sipType = sipType_QgsFieldBasedProperty;
22-
else if (dynamic_cast<QgsExpressionBasedProperty*>(sipCpp) != NULL)
22+
else if ( sipCpp->propertyType() == QgsAbstractProperty::ExpressionBasedProperty )
2323
sipType = sipType_QgsExpressionBasedProperty;
2424
else
2525
sipType = sipType_QgsAbstractProperty;

‎python/core/qgspropertycollection.sip

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ class QgsAbstractPropertyCollection
1010
%TypeHeaderCode
1111
#include <qgspropertycollection.h>
1212
%End
13+
14+
%ConvertToSubClassCode
15+
if ( dynamic_cast<QgsPropertyCollection*>(sipCpp) )
16+
sipType = sipType_QgsPropertyCollection;
17+
else if ( dynamic_cast<QgsPropertyCollectionStack*>(sipCpp) )
18+
sipType = sipType_QgsPropertyCollectionStack;
19+
else
20+
sipType = sipType_QgsAbstractPropertyCollection;
21+
%End
22+
1323
public:
1424

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

0 commit comments

Comments
 (0)
Please sign in to comment.