diff --git a/PdfForQtLib/sources/pdfrenderer.cpp b/PdfForQtLib/sources/pdfrenderer.cpp index a16bec3..ac62c22 100644 --- a/PdfForQtLib/sources/pdfrenderer.cpp +++ b/PdfForQtLib/sources/pdfrenderer.cpp @@ -219,7 +219,10 @@ QImage PDFRasterizer::render(const PDFPage* page, const PDFPrecompiledPage* comp Q_ASSERT(m_fbo); if (m_fbo->isValid() && m_fbo->bind()) { - // Now, we have bind the buffer. + // Now, we have bind the buffer. Due to bug in Qt's OpenGL drawing subsystem, + // we must render it two times, otherwise painter paths will be sometimes + // replaced by filled rectangles. + for (int i = 0; i < 2; ++i) { QOpenGLPaintDevice device(size); QPainter painter(&device); diff --git a/PdfForQtViewer/pdfrendertoimagesdialog.cpp b/PdfForQtViewer/pdfrendertoimagesdialog.cpp index 8ac39f7..13236bf 100644 --- a/PdfForQtViewer/pdfrendertoimagesdialog.cpp +++ b/PdfForQtViewer/pdfrendertoimagesdialog.cpp @@ -48,6 +48,8 @@ PDFRenderToImagesDialog::PDFRenderToImagesDialog(const pdf::PDFDocument* documen { ui->setupUi(this); + qRegisterMetaType("PDFRenderError"); + // Load image formats for (const QByteArray& format : m_imageWriterSettings.getFormats()) { diff --git a/PdfForQtViewer/pdfrendertoimagesdialog.h b/PdfForQtViewer/pdfrendertoimagesdialog.h index 5a12864..ef39b6d 100644 --- a/PdfForQtViewer/pdfrendertoimagesdialog.h +++ b/PdfForQtViewer/pdfrendertoimagesdialog.h @@ -96,4 +96,6 @@ private: } // namespace pdfviewer +Q_DECLARE_METATYPE(pdf::PDFRenderError) + #endif // PDFRENDERTOIMAGESDIALOG_H