Hi Stefan

If the text annotation is selected, you could do this:

selectedItems = qgis.utils.iface.mapCanvas().scene().selectedItems()
for i in range (len(selectedItems)):
        item=qgis.utils.iface.mapCanvas().scene().removeItem(selectedItems[i])

Regards,
Marco

Am Dienstag, 25. Januar 2011, um 08.46:47 schrieb Ziegler Stefan:
> Hi
> 
> is there a way to remove text annotations from the map canvas with Python?
> 
> regards
> Stefan
> 
> Mit freundlichem Gruss
> Stefan Ziegler
> Leiter amtliche Vermessung
> 
> Amt für Geoinformation
> Rötistrasse 4
> 4501 Solothurn
> 032 627 75 96
> _______________________________________________
> Qgis-developer mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Churerstrasse 22, CH-8808 Pfäffikon SZ, Switzerland
[email protected] http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to