25 mIconSize( 5 ), mIconType( ICON_BOX ), mGeometryType( geomType )
27 mPen = QPen( QColor( 255, 0, 0 ) );
28 mBrush = QBrush( QColor( 255, 0, 0 ) );
38 if ( !mGeometry || !painter )
44 painter->translate( -pos() );
48 painter->setBrush( mBrush );
52 painter->setBrush( Qt::NoBrush );
54 painter->setPen( mPen );
60 paintGeom->
draw( *painter );
65 while ( paintGeom->
nextVertex( vertexId, vertex ) )
67 drawVertex( painter, vertex.
x(), vertex.
y() );
74 void QgsGeometryRubberBand::drawVertex( QPainter *p,
double x,
double y )
76 qreal s = ( mIconSize - 1 ) / 2.0;
84 p->drawLine( QLineF( x - s, y, x + s, y ) );
85 p->drawLine( QLineF( x, y - s, x, y + s ) );
89 p->drawLine( QLineF( x - s, y - s, x + s, y + s ) );
90 p->drawLine( QLineF( x - s, y + s, x + s, y - s ) );
94 p->drawLine( QLineF( x - s, y - s, x + s, y - s ) );
95 p->drawLine( QLineF( x + s, y - s, x + s, y + s ) );
96 p->drawLine( QLineF( x + s, y + s, x - s, y + s ) );
97 p->drawLine( QLineF( x - s, y + s, x - s, y - s ) );
101 p->drawRect( x - s, y - s, mIconSize, mIconSize );
105 p->drawEllipse( x - s, y - s, mIconSize, mIconSize );
117 setRect( rubberBandRectangle() );
126 setRect( rubberBandRectangle() );
132 mBrush.setColor(
c );
142 mPen.setWidth( width );
147 mPen.setStyle( penStyle );
152 mBrush.setStyle( brushStyle );
155 QgsRectangle QgsGeometryRubberBand::rubberBandRectangle()
const
158 qreal s = ( mIconSize - 1 ) / 2.0 * scale;
159 qreal p = mPen.width() * scale;