Skip to content

Commit

Permalink
read and write common properties on annotation layers
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBardian authored and nyalldawson committed Jan 3, 2023
1 parent 6f975a7 commit ee2992f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/annotations/qgsannotationlayer.cpp
Expand Up @@ -440,10 +440,13 @@ bool QgsAnnotationLayer::writeXml( QDomNode &layer_node, QDomDocument &doc, cons
return writeSymbology( layer_node, doc, errorMsg, context );
}

bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString &, const QgsReadWriteContext &, QgsMapLayer::StyleCategories categories ) const
bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString &, const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories ) const
{
QGIS_PROTECT_QOBJECT_THREAD_ACCESS

QDomElement layerElement = node.toElement();
writeCommonStyle( layerElement, doc, context, categories );

// add the layer opacity
if ( categories.testFlag( Rendering ) )
{
Expand All @@ -470,10 +473,13 @@ bool QgsAnnotationLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QStr
return true;
}

bool QgsAnnotationLayer::readSymbology( const QDomNode &node, QString &, QgsReadWriteContext &, QgsMapLayer::StyleCategories categories )
bool QgsAnnotationLayer::readSymbology( const QDomNode &node, QString &, QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories )
{
QGIS_PROTECT_QOBJECT_THREAD_ACCESS

const QDomElement layerElement = node.toElement();
readCommonStyle( layerElement, context, categories );

if ( categories.testFlag( Rendering ) )
{
const QDomNode layerOpacityNode = node.namedItem( QStringLiteral( "layerOpacity" ) );
Expand Down

0 comments on commit ee2992f

Please sign in to comment.