Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8068 from m-kuhn/rubberbandProperties
Rubberband properties
  • Loading branch information
m-kuhn committed Oct 1, 2018
2 parents 27e4b19 + b60f42c commit cb7b44d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
5 changes: 4 additions & 1 deletion python/gui/auto_generated/qgsrubberband.sip.in
Expand Up @@ -8,7 +8,9 @@



class QgsRubberBand: QgsMapCanvasItem


class QgsRubberBand : QObject, QgsMapCanvasItem
{
%Docstring
A class for drawing transient features (e.g. digitizing lines) on the map.
Expand All @@ -22,6 +24,7 @@ for tracking the mouse while drawing polylines or polygons.
%End
public:


enum IconType
{

Expand Down
2 changes: 1 addition & 1 deletion python/gui/gui_auto.sip
Expand Up @@ -12,7 +12,6 @@
%Include auto_generated/qgsmaplayerconfigwidgetfactory.sip
%Include auto_generated/qgsmapmouseevent.sip
%Include auto_generated/qgsmaptip.sip
%Include auto_generated/qgsrubberband.sip
%Include auto_generated/qgssnapindicator.sip
%Include auto_generated/qgstablewidgetitem.sip
%Include auto_generated/qgsuserinputwidget.sip
Expand Down Expand Up @@ -188,6 +187,7 @@
%Include auto_generated/qgsrasterlayersaveasdialog.sip
%Include auto_generated/qgsrasterpyramidsoptionswidget.sip
%Include auto_generated/qgsrelationeditorwidget.sip
%Include auto_generated/qgsrubberband.sip
%Include auto_generated/qgsscalecombobox.sip
%Include auto_generated/qgsscalerangewidget.sip
%Include auto_generated/qgsscalevisibilitydialog.sip
Expand Down
2 changes: 1 addition & 1 deletion src/gui/CMakeLists.txt
Expand Up @@ -522,6 +522,7 @@ SET(QGIS_GUI_MOC_HDRS
qgsrasterlayersaveasdialog.h
qgsrasterpyramidsoptionswidget.h
qgsrelationeditorwidget.h
qgsrubberband.h
qgsscalecombobox.h
qgsscalerangewidget.h
qgsscalevisibilitydialog.h
Expand Down Expand Up @@ -778,7 +779,6 @@ SET(QGIS_GUI_HDRS
qgsmaplayerconfigwidgetfactory.h
qgsmapmouseevent.h
qgsmaptip.h
qgsrubberband.h
qgssnapindicator.h
qgssqlcomposerdialog.h
qgstablewidgetitem.h
Expand Down
6 changes: 4 additions & 2 deletions src/gui/qgsrubberband.cpp
Expand Up @@ -23,7 +23,8 @@
#include <QPainter>

QgsRubberBand::QgsRubberBand( QgsMapCanvas *mapCanvas, QgsWkbTypes::GeometryType geometryType )
: QgsMapCanvasItem( mapCanvas )
: QObject( nullptr )
, QgsMapCanvasItem( mapCanvas )
, mGeometryType( geometryType )
{
reset( geometryType );
Expand All @@ -37,7 +38,8 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas *mapCanvas, QgsWkbTypes::GeometryType
}

QgsRubberBand::QgsRubberBand()
: QgsMapCanvasItem( nullptr )
: QObject( nullptr )
, QgsMapCanvasItem( nullptr )
{
}

Expand Down
12 changes: 11 additions & 1 deletion src/gui/qgsrubberband.h
Expand Up @@ -18,10 +18,13 @@
#include "qgsmapcanvasitem.h"
#include "qgis.h"
#include "qgsgeometry.h"

#include <QBrush>
#include <QList>
#include <QPen>
#include <QPolygon>
#include <QObject>

#include "qgis_gui.h"

class QgsVectorLayer;
Expand All @@ -34,10 +37,17 @@ class QPaintEvent;
* The QgsRubberBand class provides a transparent overlay widget
* for tracking the mouse while drawing polylines or polygons.
*/
class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
class GUI_EXPORT QgsRubberBand : public QObject, public QgsMapCanvasItem
{
Q_OBJECT
public:

Q_PROPERTY( QColor fillColor READ fillColor WRITE setFillColor )
Q_PROPERTY( QColor strokeColor READ strokeColor WRITE setStrokeColor )
Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize )
Q_PROPERTY( QColor secondaryStrokeColor READ secondaryStrokeColor WRITE setSecondaryStrokeColor )
Q_PROPERTY( int width READ width WRITE setWidth )

//! Icons
enum IconType
{
Expand Down

0 comments on commit cb7b44d

Please sign in to comment.