pyqgis: add conversion to subclasses for QgsAbstractVectorLayerLabeling

This commit is contained in:
Martin Dobias 2018-02-03 22:28:47 +01:00
parent 57d38cd0d5
commit 4b365a8f47
2 changed files with 20 additions and 0 deletions

View File

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

View File

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