Fix pdf printing in static builds

The pdf engine uses a resource file, but Q_INIT_RESOURCE() was lacking.

Task-number: QTBUG-71070
Change-Id: I685961b3f2eea0ffe6b5313c72d504a8ad9a98e5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Eirik Aavitsland 2018-10-12 11:45:13 +02:00
parent b7887f9b4f
commit fc4b0769a5

View File

@ -71,6 +71,11 @@ static const bool do_compress = true;
// Can't use it though, as gs generates completely wrong images if this is true. // Can't use it though, as gs generates completely wrong images if this is true.
static const bool interpolateImages = false; static const bool interpolateImages = false;
static void initResources()
{
Q_INIT_RESOURCE(qpdf);
}
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
inline QPaintEngine::PaintEngineFeatures qt_pdf_decide_features() inline QPaintEngine::PaintEngineFeatures qt_pdf_decide_features()
@ -1445,6 +1450,7 @@ QPdfEnginePrivate::QPdfEnginePrivate()
grayscale(false), grayscale(false),
m_pageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(10, 10, 10, 10)) m_pageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(10, 10, 10, 10))
{ {
initResources();
resolution = 1200; resolution = 1200;
currentObject = 1; currentObject = 1;
currentPage = 0; currentPage = 0;