Skip to content

Commit 8981827

Browse files
author
homann
committed
Turn off rendering while looping through all layers hinding/showing. Fixes #1856
git-svn-id: http://svn.osgeo.org/qgis/trunk@11263 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1bb9717 commit 8981827

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/legend/qgslegend.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ void QgsLegend::selectAll( bool select )
138138
return;
139139
}
140140

141+
// Turn off rendering to improve speed.
142+
bool renderFlagState = mMapCanvas->renderFlag();
143+
mMapCanvas->setRenderFlag( false );
144+
141145
QTreeWidgetItem* theItem = firstItem();
142146

143147
while ( theItem )
@@ -150,6 +154,8 @@ void QgsLegend::selectAll( bool select )
150154
}
151155
theItem = nextItem( theItem );
152156
}
157+
// Turn on rendering (if it was on previously)
158+
mMapCanvas->setRenderFlag( renderFlagState );
153159
}
154160

155161
void QgsLegend::removeLayer( QString layer_key )

0 commit comments

Comments
 (0)