28 , mLayerOpacity( layer->opacity() )
35 QSet< QString > items = qgis::listToSet( layer->queryIndex( context.
extent() ) );
42 items.unite( layer->mNonIndexedItems );
44 mItems.reserve( items.size() );
45 std::transform( items.begin(), items.end(), std::back_inserter( mItems ),
46 [layer](
const QString &
id ) ->std::pair< QString, std::unique_ptr< QgsAnnotationItem > >
48 return std::make_pair( id, std::unique_ptr< QgsAnnotationItem >( layer->item( id )->clone() ) );
51 std::sort( mItems.begin(), mItems.end(), [](
52 const std::pair< QString, std::unique_ptr< QgsAnnotationItem > > &a,
53 const std::pair< QString, std::unique_ptr< QgsAnnotationItem > > &b )
54 { return a.second->zIndex() < b.second->zIndex(); } );
66 return mFeedback.get();
75 mPaintEffect->begin( context );
78 bool canceled =
false;
79 for (
const std::pair< QString, std::unique_ptr< QgsAnnotationItem > > &item : std::as_const( mItems ) )
81 if ( mFeedback->isCanceled() )
87 std::optional< QgsScopedRenderContextReferenceScaleOverride > referenceScaleOverride;
88 if ( item.second->useSymbologyReferenceScale() )
93 const QgsRectangle bounds = item.second->boundingBox( context );
96 item.second->render( context, mFeedback.get() );
97 std::unique_ptr< QgsRenderedAnnotationItemDetails > details = std::make_unique< QgsRenderedAnnotationItemDetails >(
mLayerID, item.first );
98 details->setBoundingBox( bounds );
105 mPaintEffect->end( context );