Skip to content
Permalink
Browse files

allow to create a QgsGeometryRubberBand as the alternative band

  • Loading branch information
SebDieBln committed Dec 21, 2015
1 parent 7afa9e3 commit aad802704112c9cd2228096fcc81cb688575c896
Showing with 7 additions and 2 deletions.
  1. +6 −1 src/gui/qgsmaptooledit.cpp
  2. +1 −1 src/gui/qgsmaptooledit.h
@@ -97,14 +97,19 @@ int QgsMapToolEdit::addTopologicalPoints( const QList<QgsPoint>& geom )
return 0;
}

QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType ) const
QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType, bool alternativeBand ) const
{
QSettings settings;
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, geometryType );
QColor color( settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 200 ).toInt() / 255.0 ;
if ( alternativeBand )
{
myAlpha = myAlpha * settings.value( "/qgis/digitizing/line_color_alpha_scale", 0.75 ).toDouble();
rb->setLineStyle( Qt::DotLine );
}
color.setAlphaF( myAlpha );
rb->setOutlineColor( color );
rb->setFillColor( color );
@@ -49,7 +49,7 @@ class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
*/
QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false );

QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line ) const;
QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line , bool alternativeBand = false ) const;

/** Returns the current vector layer of the map canvas or 0*/
QgsVectorLayer* currentVectorLayer();

0 comments on commit aad8027

Please sign in to comment.
You can’t perform that action at this time.