Skip to content

Commit ba48dbe

Browse files
committed
Merge pull request #3112 from ThomasG77/qgsannotationitemcast
Cast each child of QgsAnnotationItem in SIP bindings for Python
2 parents 84c0241 + eeea18e commit ba48dbe

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

python/gui/qgsannotationitem.sip

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
/** An annotation item can be either placed either on screen corrdinates or on map coordinates.
2-
It may reference a feature and displays that associatiation with a balloon like appearance*/
1+
/** An annotation item can be either placed either on screen coordinates or on map coordinates.
2+
It may reference a feature and displays that association with a balloon like appearance*/
3+
4+
%ModuleCode
5+
#include "qgsformannotationitem.h"
6+
#include "qgshtmlannotationitem.h"
7+
#include "qgssvgannotationitem.h"
8+
#include "qgstextannotationitem.h"
9+
%End
10+
311
class QgsAnnotationItem: QgsMapCanvasItem
412
{
513
%TypeHeaderCode
614
#include <qgsannotationitem.h>
715
%End
816

17+
%ConvertToSubClassCode
18+
if (dynamic_cast<QgsFormAnnotationItem*>(sipCpp) )
19+
sipType = sipType_QgsFormAnnotationItem;
20+
else if (dynamic_cast<QgsHtmlAnnotationItem*>(sipCpp) )
21+
sipType = sipType_QgsHtmlAnnotationItem;
22+
else if (dynamic_cast<QgsSvgAnnotationItem*>(sipCpp) )
23+
sipType = sipType_QgsSvgAnnotationItem;
24+
else if (dynamic_cast<QgsTextAnnotationItem*>(sipCpp) )
25+
sipType = sipType_QgsTextAnnotationItem;
26+
else
27+
sipType = 0;
28+
%End
29+
30+
931
public:
1032
enum MouseMoveAction
1133
{

0 commit comments

Comments
 (0)