mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Save annotations to project.qgs in creation order (fix #14812)
Save annotations to project file in the order they were loaded or created, so that annotations have the same display order each time the project is opened.
This commit is contained in:
parent
0ff10aeb0e
commit
82d465cd94
@ -1604,14 +1604,19 @@ void QgisApp::showStyleManagerV2()
|
|||||||
void QgisApp::writeAnnotationItemsToProject( QDomDocument& doc )
|
void QgisApp::writeAnnotationItemsToProject( QDomDocument& doc )
|
||||||
{
|
{
|
||||||
QList<QgsAnnotationItem*> items = annotationItems();
|
QList<QgsAnnotationItem*> items = annotationItems();
|
||||||
QList<QgsAnnotationItem*>::const_iterator itemIt = items.constBegin();
|
QgsAnnotationItem* item;
|
||||||
for ( ; itemIt != items.constEnd(); ++itemIt )
|
QListIterator<QgsAnnotationItem*> i( items );
|
||||||
|
// save lowermost annotation (at end of list) first
|
||||||
|
i.toBack();
|
||||||
|
while ( i.hasPrevious() )
|
||||||
{
|
{
|
||||||
if ( ! *itemIt )
|
item = i.previous();
|
||||||
|
|
||||||
|
if ( ! item )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
( *itemIt )->writeXML( doc );
|
item->writeXML( doc );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user