Wait till pdfworker finishes before new search, cancel running

This commit is contained in:
2018-08-30 21:54:29 +02:00
rodzic e8ef4be571
commit 53cf73cc8d
5 zmienionych plików z 52 dodań i 2 usunięć

Wyświetl plik

@@ -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);