Generalize previews: Add PreviewResult,PreviewResultPdf, remove PdfPreview

This commit is contained in:
2022-01-03 22:54:22 +01:00
parent 32286cae4b
commit 95b3d1fce2
6 changed files with 95 additions and 24 deletions

21
gui/previewresultpdf.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "previewresultpdf.h"
PreviewResultPdf::PreviewResultPdf(const PreviewResult &o)
{
this->documentPath = o.getDocumentPath();
this->page = o.getPage();
}
QWidget *PreviewResultPdf::createPreviewWidget()
{
ClickLabel *label = new ClickLabel();
label->setPixmap(QPixmap::fromImage(previewImage));
label->setToolTip(getDocumentPath());
return label;
}
bool PreviewResultPdf::hasPreview()
{
bool result = !this->previewImage.isNull();
return result;
}