Skip to content
Permalink
Browse files

Ensure newly added annotations are selected

  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4040565 commit 219a45adcbff113e8e02ad8e16de5e0e5834b147
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/app/qgsmaptoolannotation.cpp
@@ -128,6 +128,19 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent* e )
annotation->setFrameSize( QSizeF( 200, 100 ) );

QgsProject::instance()->annotationManager()->addAnnotation( annotation );

// select newly added item
Q_FOREACH ( QGraphicsItem* item , mCanvas->items() )
{
if ( QgsMapCanvasAnnotationItem* annotationItem = dynamic_cast< QgsMapCanvasAnnotationItem* >( item ) )
{
if ( annotationItem->annotation() == annotation )
{
annotationItem->setSelected( true );
break;
}
}
}
}
}
}

0 comments on commit 219a45a

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