@@ -142,6 +142,7 @@ QgsGrassEdit::QgsGrassEdit ( QgisInterface *iface, QgsMapLayer* layer, bool newM
142
142
// TODO dynamic_cast ?
143
143
mProvider = (QgsGrassProvider *) mLayer ->getDataProvider ();
144
144
145
+
145
146
init ();
146
147
147
148
}
@@ -207,6 +208,12 @@ void QgsGrassEdit::init()
207
208
return ;
208
209
}
209
210
211
+
212
+ mRubberBandLine = new QgsRubberBand (mCanvas );
213
+ mRubberBandIcon = new QgsVertexMarker (mCanvas );
214
+ mRubberBandLine ->setZValue (20 );
215
+ mRubberBandIcon ->setZValue (20 );
216
+
210
217
connect ( mCanvas , SIGNAL (keyPressed (QKeyEvent *)), this , SLOT (keyPress (QKeyEvent *)) );
211
218
212
219
QString myIconPath = QgsApplication::themePath () + " /grass/" ;
@@ -387,6 +394,8 @@ void QgsGrassEdit::init()
387
394
388
395
for ( int i = 0 ; i < SYMB_COUNT; i++ ) {
389
396
bool ok;
397
+
398
+
390
399
bool displ = settings.readBoolEntry (
391
400
spath + " display/" + QString::number (i),
392
401
true , &ok );
@@ -400,6 +409,11 @@ void QgsGrassEdit::init()
400
409
if ( ok ) {
401
410
QColor color ( colorName );
402
411
mSymb [i].setColor ( color );
412
+ // Use the 'dynamic' color for mRubberBand
413
+ if ( i == SYMB_DYNAMIC )
414
+ {
415
+ mRubberBandLine ->setColor (QColor (colorName));
416
+ }
403
417
}
404
418
mSymb [i].setWidth ( mLineWidth );
405
419
}
@@ -415,6 +429,7 @@ void QgsGrassEdit::init()
415
429
symbologyList->clear ();
416
430
symbologyList->setSorting (-1 );
417
431
432
+
418
433
for ( int i = SYMB_COUNT-1 ; i >= 0 ; i-- ) {
419
434
if ( i == SYMB_NODE_0 ) continue ;
420
435
@@ -492,10 +507,7 @@ void QgsGrassEdit::init()
492
507
493
508
mPixmap = &mCanvasEdit ->pixmap ();
494
509
495
- mRubberBandLine = new QgsRubberBand (mCanvas );
496
- mRubberBandIcon = new QgsVertexMarker (mCanvas );
497
- mRubberBandLine ->setZValue (20 );
498
- mRubberBandIcon ->setZValue (20 );
510
+
499
511
500
512
// Init GUI values
501
513
mCatModeBox ->insertItem ( tr (" Next not used" ), CAT_MODE_NEXT );
@@ -729,6 +741,11 @@ void QgsGrassEdit::changeSymbology(Q3ListViewItem * item, const QPoint & pnt, in
729
741
// TODO use a name instead of index
730
742
sn.sprintf ( " /GRASS/edit/symb/color/%d" , index );
731
743
settings.writeEntry ( sn, mSymb [index ].color ().name () );
744
+ // Use the 'dynamic' color for mRubberBand
745
+ if ( index == SYMB_DYNAMIC )
746
+ {
747
+ mRubberBandLine ->setColor (color);
748
+ }
732
749
}
733
750
}
734
751
0 commit comments