The warning is accessible only if build with Qt 5.3. ref #570.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-10-06 19:42:13 +03:00
parent 27767e46e2
commit 8d455952f8

View file

@ -964,12 +964,16 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &pr
const qreal top = FromPixel(margins.top(), Unit::Mm); const qreal top = FromPixel(margins.top(), Unit::Mm);
const qreal right = FromPixel(margins.right(), Unit::Mm); const qreal right = FromPixel(margins.right(), Unit::Mm);
const qreal bottom = FromPixel(margins.bottom(), Unit::Mm); const qreal bottom = FromPixel(margins.bottom(), Unit::Mm);
const bool success = printer->setPageMargins(left, top, right, bottom, QPrinter::Millimeter); #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
const bool success = printer->setPageMargins(QMarginsF(left, top, right, bottom), QPageLayout::Millimeter);
if (not success) if (not success)
{ {
qWarning() << tr("Cannot set printer margins"); qWarning() << tr("Cannot set printer margins");
} }
#else
printer->setPageMargins(left, top, right, bottom, QPrinter::Millimeter);
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
switch(printType) switch(printType)
{ {