Fix sip subclassing for properties

This commit is contained in:
Nyall Dawson 2017-01-10 12:34:08 +10:00
parent 53ba1a1f10
commit ef3f61fc17
2 changed files with 13 additions and 3 deletions

View File

@ -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;

View File

@ -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() );