Skip to content

Commit 4b365a8

Browse files
committed
pyqgis: add conversion to subclasses for QgsAbstractVectorLayerLabeling
1 parent 57d38cd commit 4b365a8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

python/core/qgsvectorlayerlabeling.sip.in

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Abstract base class - its implementations define different approaches to the lab
2121

2222
%TypeHeaderCode
2323
#include "qgsvectorlayerlabeling.h"
24+
%End
25+
%ConvertToSubClassCode
26+
if ( sipCpp->type() == "simple" )
27+
sipType = sipType_QgsVectorLayerSimpleLabeling;
28+
else if ( sipCpp->type() == "rule-based" )
29+
sipType = sipType_QgsRuleBasedLabeling;
30+
else
31+
sipType = 0;
2432
%End
2533
public:
2634
QgsAbstractVectorLayerLabeling();

src/core/qgsvectorlayerlabeling.h

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ class QgsVectorLayerLabelProvider;
3939
*/
4040
class CORE_EXPORT QgsAbstractVectorLayerLabeling
4141
{
42+
43+
#ifdef SIP_RUN
44+
SIP_CONVERT_TO_SUBCLASS_CODE
45+
if ( sipCpp->type() == "simple" )
46+
sipType = sipType_QgsVectorLayerSimpleLabeling;
47+
else if ( sipCpp->type() == "rule-based" )
48+
sipType = sipType_QgsRuleBasedLabeling;
49+
else
50+
sipType = 0;
51+
SIP_END
52+
#endif
53+
4254
public:
4355
//! Default constructor
4456
QgsAbstractVectorLayerLabeling() = default;

0 commit comments

Comments
 (0)