Skip to content
Permalink
Browse files

Handle QgsDataItem class hierarchy in SIP bindings

  • Loading branch information
mhugo committed Jul 30, 2015
1 parent 1c6a40c commit 95ff0922e4b14ec1ccd8e452bf597bf7c4c80b27
Showing with 17 additions and 0 deletions.
  1. +17 −0 python/core/qgsdataitem.sip
@@ -2,6 +2,23 @@ class QgsDataItem : QObject
{
%TypeHeaderCode
#include <qgsdataitem.h>
%End

%ConvertToSubClassCode
if (qobject_cast<QgsLayerItem*>(sipCpp))
sipType = sipType_QgsLayerItem;
else if (qobject_cast<QgsErrorItem*>(sipCpp))
sipType = sipType_QgsErrorItem;
else if (qobject_cast<QgsDirectoryItem*>(sipCpp))
sipType = sipType_QgsDirectoryItem;
else if (qobject_cast<QgsFavouritesItem*>(sipCpp))
sipType = sipType_QgsFavouritesItem;
else if (qobject_cast<QgsZipItem*>(sipCpp))
sipType = sipType_QgsZipItem;
else if (qobject_cast<QgsDataCollectionItem*>(sipCpp))
sipType = sipType_QgsDataCollectionItem;
else
sipType = 0;
%End
public:
enum Type

0 comments on commit 95ff092

Please sign in to comment.
You can’t perform that action at this time.