File tree Expand file tree Collapse file tree
python/core/auto_generated/layout Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ The caller takes responsibility for deleting the returned object.
5353
5454 virtual QString displayName() const;
5555
56+ virtual QPainterPath shape() const;
57+
5658
5759 QgsLineSymbol *symbol();
5860%Docstring
Original file line number Diff line number Diff line change 2525#include " qgssvgcache.h"
2626#include < QSvgRenderer>
2727#include < limits>
28+ #include < QGraphicsPathItem>
2829
2930QgsLayoutItemPolyline::QgsLayoutItemPolyline ( QgsLayout *layout )
3031 : QgsLayoutNodesItem( layout )
@@ -312,6 +313,19 @@ void QgsLayoutItemPolyline::setArrowHeadWidth( double width )
312313 update ();
313314}
314315
316+ QPainterPath QgsLayoutItemPolyline::shape () const
317+ {
318+ QPainterPath path;
319+ path.addPolygon ( mPolygon );
320+
321+ QPainterPathStroker ps;
322+
323+ ps.setWidth ( 2 * mMaxSymbolBleed );
324+ QPainterPath strokedOutline = ps.createStroke ( path );
325+
326+ return strokedOutline;
327+ }
328+
315329void QgsLayoutItemPolyline::setStartSvgMarkerPath ( const QString &path )
316330{
317331 QSvgRenderer r;
Original file line number Diff line number Diff line change 2020#include " qgis_core.h"
2121#include " qgslayoutitemnodeitem.h"
2222#include " qgssymbol.h"
23+ #include < QGraphicsPathItem>
24+ #include " qgslogger.h"
25+ #include " qgslayout.h"
2326
2427/* *
2528 * \ingroup core
@@ -61,6 +64,7 @@ class CORE_EXPORT QgsLayoutItemPolyline: public QgsLayoutNodesItem
6164 int type () const override ;
6265 QIcon icon () const override ;
6366 QString displayName () const override ;
67+ QPainterPath shape () const override ;
6468
6569 /* *
6670 * Returns the line symbol used to draw the shape.
You can’t perform that action at this time.
0 commit comments