Skip to content

Commit

Permalink
Fix initial zoom level when opening layout designer windows
Browse files Browse the repository at this point in the history
Fixes #44421
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Oct 9, 2023
1 parent 520192e commit ea05a59
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -1372,7 +1372,15 @@ void QgsLayoutDesignerDialog::open()
activate();
if ( mView )
{
mView->zoomFull(); // zoomFull() does not work properly until we have called show()
mView->setPaintingEnabled( false );
// zoomFull() does not work properly until window has fully shown.
// It's not enough to just call show on it, because the view widget won't be fully
// resized to its final size until a little later...!
QTimer::singleShot( 100, this, [ = ]
{
mView->zoomFull();
mView->setPaintingEnabled( true );
} );
}

if ( mMasterLayout && mMasterLayout->layoutType() == QgsMasterLayoutInterface::Report )
Expand Down

0 comments on commit ea05a59

Please sign in to comment.