Skip to content
Permalink
Browse files
Make the "zoom to" action really zoom to a group box instead of pan
  • Loading branch information
DelazJ authored and github-actions committed Nov 18, 2021
1 parent 3af98b1 commit 101d05c6bcecb7ee8ed8ebd241eccf54fa9ba4ff
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/processing/models/qgsmodeldesignerdialog.cpp
@@ -531,7 +531,7 @@ bool QgsModelDesignerDialog::validateSave()
{
if ( mNameEdit->text().trimmed().isEmpty() )
{
mMessageBar->pushWarning( QString(), tr( "Please a enter model name before saving" ) );
mMessageBar->pushWarning( QString(), tr( "Please enter a model name before saving" ) );
return false;
}

@@ -832,6 +832,9 @@ void QgsModelDesignerDialog::populateZoomToMenu()
QAction *zoomAction = new QAction( box.description(), mGroupMenu );
connect( zoomAction, &QAction::triggered, this, [ = ]
{
QRectF groupRect = item->boundingRect();
groupRect.adjust( -10, -10, 10, 10 );
mView->fitInView( groupRect, Qt::KeepAspectRatio );
mView->centerOn( item );
} );
mGroupMenu->addAction( zoomAction );

0 comments on commit 101d05c

Please sign in to comment.