From 8d455952f89719821ee92d1f768a6a5c6fe66053 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 6 Oct 2016 19:42:13 +0300 Subject: [PATCH] The warning is accessible only if build with Qt 5.3. ref #570. --HG-- branch : develop --- src/app/valentina/mainwindowsnogui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index b5ac49e0b..d2451958c 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -964,12 +964,16 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &pr const qreal top = FromPixel(margins.top(), Unit::Mm); const qreal right = FromPixel(margins.right(), 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) { 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) {