mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2024-12-27 08:42:48 +01:00
Bugfixing: Output preview dialog crash and scrollbar update
This commit is contained in:
parent
9dcdf10d1a
commit
c633b1b4b8
@ -50,6 +50,7 @@ OutputPreviewDialog::OutputPreviewDialog(const pdf::PDFDocument* document, pdf::
|
||||
connect(ui->redPaperColorEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &OutputPreviewDialog::onPaperColorChanged);
|
||||
connect(ui->greenPaperColorEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &OutputPreviewDialog::onPaperColorChanged);
|
||||
connect(ui->bluePaperColorEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &OutputPreviewDialog::onPaperColorChanged);
|
||||
connect(ui->pageIndexScrollBar, &QScrollBar::valueChanged, this, &OutputPreviewDialog::updatePageImage);
|
||||
connect(ui->inksTreeWidget->model(), &QAbstractItemModel::dataChanged, this, &OutputPreviewDialog::onInksChanged);
|
||||
|
||||
updatePageImage();
|
||||
@ -295,16 +296,19 @@ void OutputPreviewDialog::onPageImageRendered()
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
RenderedImage result = m_future.result();
|
||||
m_future = QFuture<RenderedImage>();
|
||||
m_futureWatcher->deleteLater();
|
||||
m_futureWatcher = nullptr;
|
||||
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(result.image));
|
||||
|
||||
if (m_needUpdateImage)
|
||||
if (m_future.isFinished())
|
||||
{
|
||||
updatePageImage();
|
||||
RenderedImage result = m_future.result();
|
||||
m_future = QFuture<RenderedImage>();
|
||||
m_futureWatcher->deleteLater();
|
||||
m_futureWatcher = nullptr;
|
||||
|
||||
ui->imageLabel->setPixmap(QPixmap::fromImage(result.image));
|
||||
|
||||
if (m_needUpdateImage)
|
||||
{
|
||||
updatePageImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user