@@ -197,18 +197,13 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
197197 QToolButton *topoButton = new QToolButton ();
198198 topoButton->addAction ( mTopologicalEditingAction );
199199 topoButton->setDefaultAction ( mTopologicalEditingAction );
200- if ( mDisplayMode == Widget )
201- {
202- topoButton->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
203- }
200+ topoButton->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
204201 layout->addWidget ( topoButton );
202+
205203 QToolButton *interButton = new QToolButton ();
206204 interButton->addAction ( mIntersectionSnappingAction );
207205 interButton->setDefaultAction ( mIntersectionSnappingAction );
208- if ( mDisplayMode == Widget )
209- {
210- interButton->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
211- }
206+ interButton->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
212207 layout->addWidget ( interButton );
213208
214209 layout->setContentsMargins ( 0 , 0 , 0 , 0 );
@@ -384,8 +379,8 @@ void QgsSnappingWidget::enableIntersectionSnapping( bool enabled )
384379
385380void QgsSnappingWidget::onSnappingTreeLayersChanged ()
386381{
382+ mLayerTreeView ->expandAll ();
387383 mLayerTreeView ->resizeColumnToContents ( 0 );
388- QTimer::singleShot ( 0 , mLayerTreeView , &QTreeView::expandAll );
389384}
390385
391386void QgsSnappingWidget::modeButtonTriggered ( QAction *action )
0 commit comments