Add ProgressFun

This commit is contained in:
Anton Thomasson 2021-11-14 19:28:39 +01:00
parent b93568ad18
commit 0ab3d5486d
2 changed files with 7 additions and 2 deletions

@ -1 +1 @@
Subproject commit 6a93de071f3d2814260da5fe2ea14352483ea0a0 Subproject commit c5d67c2188cbb5cd7714ba3342b5b5507269b4a0

View file

@ -155,6 +155,11 @@ try {
return true; return true;
}); });
progress_fun ProgressFun([this](size_t page, size_t total) -> void
{
emit progress(page, total);
});
if(!PaperSizes.contains(PaperSize)) if(!PaperSizes.contains(PaperSize))
{ {
qDebug() << "Unsupported paper size" << PaperSize; qDebug() << "Unsupported paper size" << PaperSize;
@ -165,7 +170,7 @@ try {
float Height = size.height(); float Height = size.height();
int res = pdf_to_printable(filename.toStdString(), WriteFun, Colors, Quality, PaperSize.toStdString(), Width, Height, HwResX, HwResY, int res = pdf_to_printable(filename.toStdString(), WriteFun, Colors, Quality, PaperSize.toStdString(), Width, Height, HwResX, HwResY,
format, TwoSided, Tumble, BackHFlip, BackVFlip, PageRangeLow, PageRangeHigh); format, TwoSided, Tumble, BackHFlip, BackVFlip, PageRangeLow, PageRangeHigh, ProgressFun);
if(res != 0) if(res != 0)
{ {