void QgsDualView::zoomToCurrentFeature() { QModelIndex currentIndex = mTableView->currentIndex(); if ( !currentIndex.isValid() ) { return; } QgsFeatureIds ids; ids.insert( mFilterModel->rowToId( currentIndex ) ); QgsMapCanvas *canvas = mFilterModel->mapCanvas(); if ( canvas ) { canvas->zoomToFeatureIds( mLayer, ids ); } }
void QgsDualView::panOrZoomToFeature( const QgsFeatureIds &featureset ) { QgsMapCanvas *canvas = mFilterModel->mapCanvas(); if ( canvas ) { if ( mAutoPanButton->isChecked() ) QTimer::singleShot( 0, this, [ = ]() { canvas->panToFeatureIds( mLayer, featureset, false ); } ); else if ( mAutoZoomButton->isChecked() ) QTimer::singleShot( 0, this, [ = ]() { canvas->zoomToFeatureIds( mLayer, featureset ); } ); if ( mFlashButton->isChecked() ) QTimer::singleShot( 0, this, [ = ]() { canvas->flashFeatureIds( mLayer, featureset ); } ); } }