Updated for new boost::placeholders. Drop deprecated Qt4 code.

This commit is contained in:
Jean-Paul Chaput 2023-09-21 12:45:20 +02:00
parent 3d8d737aaf
commit 2633fb543b
2 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@
#include <unistd.h>
#include <algorithm>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <QApplication>
#include <QImage>
#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;

View File

@ -17,7 +17,7 @@
#include <unistd.h>
#include <algorithm>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <QApplication>
#include <QPrinter>
#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;