Skip to content

Commit

Permalink
Fix assert showing default-constructed QPrintPreviewDialog
Browse files Browse the repository at this point in the history
Fix call to qBound(), avoiding an assert introduced
by ad5c5bb.

Pick-to: 6.3
Fixes: QTBUG-101297
Change-Id: I823cdfcd2491c6bb4c87058318479d188ca38742
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
FriedemannKleint committed Feb 28, 2022
1 parent 5b07f14 commit 95603e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/printsupport/widgets/qprintpreviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void QPrintPreviewWidgetPrivate::generatePreview()
pictures = printer->d_func()->previewPages();
populateScene(); // i.e. setPreviewPrintedPictures() e.l.
layoutPages();
curPage = qBound(1, curPage, pages.count());
curPage = pages.count() > 0 ? qBound(1, curPage, pages.count()) : 1;
if (fitting)
_q_fit();
emit q->previewChanged();
Expand Down

0 comments on commit 95603e0

Please sign in to comment.