Skip to content

Commit

Permalink
pyqgis: add conversion to subclasses for QgsAbstractVectorLayerLabeling
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Feb 3, 2018
1 parent 57d38cd commit 4b365a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/core/qgsvectorlayerlabeling.sip.in
Expand Up @@ -21,6 +21,14 @@ Abstract base class - its implementations define different approaches to the lab

%TypeHeaderCode
#include "qgsvectorlayerlabeling.h"
%End
%ConvertToSubClassCode
if ( sipCpp->type() == "simple" )
sipType = sipType_QgsVectorLayerSimpleLabeling;
else if ( sipCpp->type() == "rule-based" )
sipType = sipType_QgsRuleBasedLabeling;
else
sipType = 0;
%End
public:
QgsAbstractVectorLayerLabeling();
Expand Down
12 changes: 12 additions & 0 deletions src/core/qgsvectorlayerlabeling.h
Expand Up @@ -39,6 +39,18 @@ class QgsVectorLayerLabelProvider;
*/
class CORE_EXPORT QgsAbstractVectorLayerLabeling
{

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( sipCpp->type() == "simple" )
sipType = sipType_QgsVectorLayerSimpleLabeling;
else if ( sipCpp->type() == "rule-based" )
sipType = sipType_QgsRuleBasedLabeling;
else
sipType = 0;
SIP_END
#endif

public:
//! Default constructor
QgsAbstractVectorLayerLabeling() = default;
Expand Down

0 comments on commit 4b365a8

Please sign in to comment.