Wait till pdfworker finishes before new search, cancel running

This commit is contained in:
2018-08-30 21:54:29 +02:00
parent e8ef4be571
commit 53cf73cc8d
5 changed files with 52 additions and 2 deletions

View File

@@ -121,7 +121,10 @@ void MainWindow::makePdfPreview()
{
if(!pdfWorkerThread.isRunning())
pdfWorkerThread.start();
qDeleteAll(ui->scrollAreaWidgetContents->children());
pdfWorker->cancelAndWait();
QCoreApplication::processEvents(); //Process not processed images
qDeleteAll(ui->scrollAreaWidgetContents->children());
ui->scrollAreaWidgetContents->setLayout(new QHBoxLayout());
emit startPdfPreviewGeneration(this->pdfSearchResults, 0.75);