Skip to content

Commit

Permalink
Handle QgsDataItem class hierarchy in SIP bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Mercier committed Jul 30, 2015
1 parent 1c6a40c commit 95ff092
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/core/qgsdataitem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95ff092

Please sign in to comment.