Skip to content

Commit c1658fb

Browse files
committed
Flip some connects to new style
1 parent a0166d9 commit c1658fb

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

‎src/app/qgsbrowserdockwidget.cpp‎

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ QgsBrowserPropertiesWrapLabel::QgsBrowserPropertiesWrapLabel( const QString& tex
4949
setPalette( pal );
5050
setLineWrapMode( QTextEdit::WidgetWidth );
5151
setWordWrapMode( QTextOption::WrapAnywhere );
52-
connect( qobject_cast<QObject*>( document()->documentLayout() ), SIGNAL( documentSizeChanged( QSizeF ) ),
53-
this, SLOT( adjustHeight( QSizeF ) ) );
52+
connect( qobject_cast<QAbstractTextDocumentLayout*>( document()->documentLayout() ), &QAbstractTextDocumentLayout::documentSizeChanged,
53+
this, &QgsBrowserPropertiesWrapLabel::adjustHeight );
5454
setMaximumHeight( 20 );
5555
}
5656

@@ -289,7 +289,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( const QString& name, QWidget * paren
289289
action->setData( "case" );
290290
action->setCheckable( true );
291291
action->setChecked( false );
292-
connect( action, SIGNAL( toggled( bool ) ), this, SLOT( setCaseSensitive( bool ) ) );
292+
connect( action, &QAction::toggled, this, &QgsBrowserDockWidget::setCaseSensitive );
293293
menu->addAction( action );
294294
QActionGroup* group = new QActionGroup( menu );
295295
action = new QAction( tr( "Filter Pattern Syntax" ), group );
@@ -309,18 +309,18 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( const QString& name, QWidget * paren
309309
action->setCheckable( true );
310310
menu->addAction( action );
311311

312-
connect( mActionRefresh, SIGNAL( triggered( bool ) ), this, SLOT( refresh() ) );
313-
connect( mActionAddLayers, SIGNAL( triggered( bool ) ), this, SLOT( addSelectedLayers() ) );
314-
connect( mActionCollapse, SIGNAL( triggered( bool ) ), mBrowserView, SLOT( collapseAll() ) );
315-
connect( mActionShowFilter, SIGNAL( triggered( bool ) ), this, SLOT( showFilterWidget( bool ) ) );
316-
connect( mActionPropertiesWidget, SIGNAL( triggered( bool ) ), this, SLOT( enablePropertiesWidget( bool ) ) );
317-
connect( mLeFilter, SIGNAL( returnPressed() ), this, SLOT( setFilter() ) );
318-
connect( mLeFilter, SIGNAL( cleared() ), this, SLOT( setFilter() ) );
319-
connect( mLeFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( setFilter() ) );
320-
connect( group, SIGNAL( triggered( QAction * ) ), this, SLOT( setFilterSyntax( QAction * ) ) );
321-
connect( mBrowserView, SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( showContextMenu( const QPoint & ) ) );
322-
connect( mBrowserView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( addLayerAtIndex( const QModelIndex& ) ) );
323-
connect( mSplitter, SIGNAL( splitterMoved( int, int ) ), this, SLOT( splitterMoved() ) );
312+
connect( mActionRefresh, &QAction::triggered, this, &QgsBrowserDockWidget::refresh );
313+
connect( mActionAddLayers, &QAction::triggered, this, &QgsBrowserDockWidget::addSelectedLayers );
314+
connect( mActionCollapse, &QAction::triggered, mBrowserView, &QgsDockBrowserTreeView::collapseAll );
315+
connect( mActionShowFilter, &QAction::triggered, this, &QgsBrowserDockWidget::showFilterWidget );
316+
connect( mActionPropertiesWidget, &QAction::triggered, this, &QgsBrowserDockWidget::enablePropertiesWidget );
317+
connect( mLeFilter, &QgsFilterLineEdit::returnPressed, this, &QgsBrowserDockWidget::setFilter );
318+
connect( mLeFilter, &QgsFilterLineEdit::cleared, this, &QgsBrowserDockWidget::setFilter );
319+
connect( mLeFilter, &QgsFilterLineEdit::textChanged, this, &QgsBrowserDockWidget::setFilter );
320+
connect( group, &QActionGroup::triggered, this, &QgsBrowserDockWidget::setFilterSyntax );
321+
connect( mBrowserView, &QgsDockBrowserTreeView::customContextMenuRequested, this, &QgsBrowserDockWidget::showContextMenu );
322+
connect( mBrowserView, &QgsDockBrowserTreeView::doubleClicked, this, &QgsBrowserDockWidget::addLayerAtIndex );
323+
connect( mSplitter, &QSplitter::splitterMoved, this, &QgsBrowserDockWidget::splitterMoved );
324324
}
325325

326326
QgsBrowserDockWidget::~QgsBrowserDockWidget()
@@ -338,7 +338,7 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
338338
{
339339
mModel = new QgsBrowserModel( mBrowserView );
340340

341-
connect( QgisApp::instance(), SIGNAL( newProject() ), mModel, SLOT( updateProjectHome() ) );
341+
connect( QgisApp::instance(), &QgisApp::newProject, mModel, &QgsBrowserModel::updateProjectHome );
342342

343343
mProxyModel = new QgsBrowserTreeFilterProxyModel( this );
344344
mProxyModel->setBrowserModel( mModel );
@@ -350,8 +350,8 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
350350
mBrowserView->header()->setStretchLastSection( false );
351351

352352
// selectionModel is created when model is set on tree
353-
connect( mBrowserView->selectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & ) ),
354-
this, SLOT( selectionChanged( const QItemSelection &, const QItemSelection & ) ) );
353+
connect( mBrowserView->selectionModel(), &QItemSelectionModel::selectionChanged,
354+
this, &QgsBrowserDockWidget::selectionChanged );
355355

356356
// objectName used by settingsSection() is not yet set in constructor
357357
QSettings settings;
@@ -389,29 +389,28 @@ void QgsBrowserDockWidget::showContextMenu( QPoint pt )
389389
if ( item->parent() && !inFavDirs )
390390
{
391391
// only non-root directories can be added as favorites
392-
menu->addAction( tr( "Add as a Favorite" ), this, SLOT( addFavorite() ) );
392+
menu->addAction( tr( "Add as a Favorite" ), this, &QgsBrowserDockWidget::addFavorite );
393393
}
394394
else if ( inFavDirs )
395395
{
396396
// only favorites can be removed
397-
menu->addAction( tr( "Remove Favorite" ), this, SLOT( removeFavorite() ) );
397+
menu->addAction( tr( "Remove Favorite" ), this, &QgsBrowserDockWidget::removeFavorite );
398398
}
399-
menu->addAction( tr( "Properties..." ), this, SLOT( showProperties() ) );
400-
menu->addAction( tr( "Hide from Browser" ), this, SLOT( hideItem() ) );
401-
QAction *action = menu->addAction( tr( "Fast Scan this Directory" ), this, SLOT( toggleFastScan() ) );
399+
menu->addAction( tr( "Properties..." ), this, &QgsBrowserDockWidget::showProperties );
400+
menu->addAction( tr( "Hide from Browser" ), this, &QgsBrowserDockWidget::hideItem );
401+
QAction *action = menu->addAction( tr( "Fast Scan this Directory" ), this, &QgsBrowserDockWidget::toggleFastScan );
402402
action->setCheckable( true );
403403
action->setChecked( settings.value( QStringLiteral( "/qgis/scanItemsFastScanUris" ),
404404
QStringList() ).toStringList().contains( item->path() ) );
405405
}
406406
else if ( item->type() == QgsDataItem::Layer )
407407
{
408-
menu->addAction( tr( "Add Selected Layer(s)" ), this, SLOT( addSelectedLayers() ) );
409-
menu->addAction( tr( "Properties..." ), this, SLOT( showProperties() ) );
408+
menu->addAction( tr( "Add Selected Layer(s)" ), this, &QgsBrowserDockWidget::addSelectedLayers );
409+
menu->addAction( tr( "Properties..." ), this, &QgsBrowserDockWidget::showProperties );
410410
}
411411
else if ( item->type() == QgsDataItem::Favorites )
412412
{
413-
menu->addAction( tr( "Add a Directory..." ), this, SLOT( addFavoriteDirectory() ) );
414-
413+
menu->addAction( tr( "Add a Directory..." ), this, [this] { addFavoriteDirectory(); } );
415414
}
416415

417416
QList<QAction*> actions = item->actions();

0 commit comments

Comments
 (0)