From 2633fb543ba1333ee230775366a31d3f08d9bd78 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 21 Sep 2023 12:45:20 +0200 Subject: [PATCH] Updated for new boost::placeholders. Drop deprecated Qt4 code. --- hurricane/src/viewer/CellImage.cpp | 4 ++-- hurricane/src/viewer/CellPrinter.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hurricane/src/viewer/CellImage.cpp b/hurricane/src/viewer/CellImage.cpp index 367adafa..319cbd95 100644 --- a/hurricane/src/viewer/CellImage.cpp +++ b/hurricane/src/viewer/CellImage.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include "hurricane/configuration/Configuration.h" @@ -200,7 +200,7 @@ namespace Hurricane { //cerr << "(w,h) = (" << w << "," << h << ")" << endl; //cerr << "(dw,dh) = (" << drawingWidth << "," << drawingHeight << ")" << endl; - CellWidget::PainterCb_t cb = boost::bind( &CellImage::pageDecorate, this, _1 ); + CellWidget::PainterCb_t cb = boost::bind( &CellImage::pageDecorate, this, boost::placeholders::_1 ); _cellWidget->copyToImage( _image, cb ); return _image; diff --git a/hurricane/src/viewer/CellPrinter.cpp b/hurricane/src/viewer/CellPrinter.cpp index 082eae62..78db6e36 100644 --- a/hurricane/src/viewer/CellPrinter.cpp +++ b/hurricane/src/viewer/CellPrinter.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include "hurricane/configuration/Configuration.h" @@ -223,8 +223,8 @@ namespace Hurricane { // ); // Rotate the painter for the cartouche if in A4+Landscape mode. - if ( (_printer->paperSize () == QPrinter::A4) - and (_printer->orientation() == QPrinter::Landscape) ) { + if ( (_printer->pageLayout().pageSize().id() == QPageSize::A4) + and (_printer->pageLayout().orientation() == QPageLayout::Landscape) ) { painter.translate ( _paperWidth - frameMargin(), frameMargin() ); painter.rotate ( -90 ); } else @@ -326,7 +326,7 @@ namespace Hurricane { _printer = printer; _printer->setResolution ( _dpi ); - _printer->setPageMargins( 0.0, 0.0, 0.0, 0.0, QPrinter::DevicePixel ); + _printer->setPageMargins( QMarginsF(0.0, 0.0, 0.0, 0.0), QPageLayout::Millimeter ); _paperWidth = _printer->width (); _paperHeight = _printer->height (); @@ -336,7 +336,7 @@ namespace Hurricane { _ypaper = (imageOnly) ? 0 : frameMargin(); // Substract the cartouche size only for A4 format. - if ( _printer->orientation() == QPrinter::Landscape ) { + if ( _printer->pageLayout().orientation() == QPageLayout::Landscape ) { _drawingWidth -= cartoucheHeight(); } else { _drawingHeight -= cartoucheHeight(); @@ -378,7 +378,7 @@ namespace Hurricane { //cerr << " (xpaper,ypaper) = (" << _xpaper << "," << _ypaper << ")" << endl; //cerr << " (dw,dh) = (" << _drawingWidth << "," << _drawingHeight << ")" << endl; - CellWidget::PainterCb_t cb = boost::bind( &CellPrinter::pageDecorate, this, _1 ); + CellWidget::PainterCb_t cb = boost::bind( &CellPrinter::pageDecorate, this, boost::placeholders::_1 ); _cellWidget->copyToPrinter( _xpaper, _ypaper, _printer, cb ); _printer = NULL;