Skip to content

Commit 62bd377

Browse files
committed
Allow better resizing of Projection selector widget tree
1 parent af6b4cc commit 62bd377

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/app/qgssnappingwidget.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

385380
void QgsSnappingWidget::onSnappingTreeLayersChanged()
386381
{
382+
mLayerTreeView->expandAll();
387383
mLayerTreeView->resizeColumnToContents( 0 );
388-
QTimer::singleShot( 0, mLayerTreeView, &QTreeView::expandAll );
389384
}
390385

391386
void QgsSnappingWidget::modeButtonTriggered( QAction *action )

0 commit comments

Comments
 (0)