# HG changeset patch # User Matti Hamalainen # Date 1499680355 -10800 # Node ID a063cb8a171b1cc3f48b75f4a48319c902d1b409 # Parent e76d85ea87acd4dfbad46ef1fdc4e1f775dd4519 Set print preview dialog window modality before initializing progress dialog. diff -r e76d85ea87ac -r a063cb8a171b src/main.cpp --- a/src/main.cpp Thu Jul 06 15:47:18 2017 +0300 +++ b/src/main.cpp Mon Jul 10 12:52:35 2017 +0300 @@ -551,6 +551,7 @@ // Create print preview dialog and show it QPrintPreviewDialog preview(&printer, this); + preview.setWindowModality(Qt::ApplicationModal); preview.setSizeGripEnabled(true); connect( @@ -573,6 +574,8 @@ 1, this); + progress.setWindowModality(Qt::ApplicationModal); + // Again, get the page info here .. we need the number of lines per page SLPageInfo pinfo; pinfo.npages = 0; @@ -592,11 +595,9 @@ printer->setFromTo(1, pinfo.npages); // Setup rest of the progress dialog here - progress.setWindowModality(Qt::ApplicationModal); progress.setMinimum(printer->fromPage() - 1); progress.setMaximum(printer->toPage()); - // Begin painting to the printer (or preview) QPainter painter; painter.begin(printer);