Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ensure newly added annotations are selected
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4040565 commit 219a45a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/qgsmaptoolannotation.cpp
Expand Up @@ -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;
}
}
}
}
}
}
Expand Down

0 comments on commit 219a45a

Please sign in to comment.