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 committed Oct 28, 2023
1 parent 01c7037 commit b9d26a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
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 b9d26a0

Please sign in to comment.