QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgscomposerpolyline.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposerpolyline.h
3  begin : March 2016
4  copyright : (C) 2016 Paul Blottiere, Oslandia
5  email : paul dot blottiere at oslandia dot com
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSCOMPOSERPOLYLINE_H
18 #define QGSCOMPOSERPOLYLINE_H
19 
20 #include "qgscomposernodesitem.h"
21 #include <QBrush>
22 #include <QPen>
23 
24 class QgsLineSymbolV2;
25 
30 class CORE_EXPORT QgsComposerPolyline: public QgsComposerNodesItem
31 {
32  Q_OBJECT
33 
34  public:
35 
40 
46 
49 
51  virtual QString displayName() const override;
52 
54  QgsLineSymbolV2* polylineStyleSymbol() { return mPolylineStyleSymbol.data(); }
55 
57  void setPolylineStyleSymbol( QgsLineSymbolV2* symbol );
58 
60  virtual int type() const override { return ComposerPolyline; }
61 
62  protected:
63 
66 
69  bool _addNode( const int indexPoint, const QPointF &newPoint, const double radius ) override;
70 
71  bool _removeNode( const int nodeIndex ) override;
72 
74  void _draw( QPainter *painter ) override;
75 
77  void _readXMLStyle( const QDomElement &elmt ) override;
78 
80  void _writeXMLStyle( QDomDocument &doc, QDomElement &elmt ) const override;
81 
83  void createDefaultPolylineStyleSymbol();
84 };
85 
86 #endif // QGSCOMPOSERPOLYLINE_H
87 
An abstract composer item that provides generic methods for nodes based shapes such as polygon or pol...
virtual QString displayName() const
Get item display name.
Composer item for polylines.
virtual void _readXMLStyle(const QDomElement &elmt)=0
Method called in readXML.
QgsLineSymbolV2 * polylineStyleSymbol()
Returns the QgsSymbolV2 used to draw the shape.
virtual void _writeXMLStyle(QDomDocument &doc, QDomElement &elmt) const =0
Method called in writeXML.
virtual bool _removeNode(const int nodeIndex)=0
Method called in removeNode.
virtual int type() const override
Overridden to return shape type.
virtual bool _addNode(const int nodeIndex, const QPointF &newNode, const double radius)=0
Method called in addNode.
virtual void _draw(QPainter *painter)=0
Method called in paint.
Graphics scene for map printing.
QScopedPointer< QgsLineSymbolV2 > mPolylineStyleSymbol
QgsSymbolV2 use to draw the shape.