Skip to content
Permalink
Browse files

Add clear method to QgsAnnotationLayer

  • Loading branch information
nyalldawson committed Aug 27, 2020
1 parent cb51326 commit 199cd7e8d2df6bbaa0fa86b177d6cf5018fddb20
@@ -62,6 +62,11 @@ Returns the unique ID assigned to the item.
bool removeItem( const QString &id );
%Docstring
Removes (and deletes) the item with matching ``id``.
%End

void clear();
%Docstring
Removes all items from the layer.
%End

QMap<QString, QgsAnnotationItem *> items() const;
@@ -51,6 +51,12 @@ bool QgsAnnotationLayer::removeItem( const QString &id )
return true;
}

void QgsAnnotationLayer::clear()
{
qDeleteAll( mItems );
mItems.clear();
}

QgsAnnotationLayer *QgsAnnotationLayer::clone() const
{
QgsAnnotationLayer::LayerOptions options( mTransformContext );
@@ -86,6 +86,11 @@ class CORE_EXPORT QgsAnnotationLayer : public QgsMapLayer
*/
bool removeItem( const QString &id );

/**
* Removes all items from the layer.
*/
void clear();

/**
* Returns a map of items contained in the layer, by unique item ID.
*

0 comments on commit 199cd7e

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