Updated for new boost::placeholders. Drop deprecated Qt4 code.
This commit is contained in:
parent
3d8d737aaf
commit
2633fb543b
|
@ -18,7 +18,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind/bind.hpp>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include "hurricane/configuration/Configuration.h"
|
#include "hurricane/configuration/Configuration.h"
|
||||||
|
@ -200,7 +200,7 @@ namespace Hurricane {
|
||||||
//cerr << "(w,h) = (" << w << "," << h << ")" << endl;
|
//cerr << "(w,h) = (" << w << "," << h << ")" << endl;
|
||||||
//cerr << "(dw,dh) = (" << drawingWidth << "," << drawingHeight << ")" << 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 );
|
_cellWidget->copyToImage( _image, cb );
|
||||||
|
|
||||||
return _image;
|
return _image;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind/bind.hpp>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
#include "hurricane/configuration/Configuration.h"
|
#include "hurricane/configuration/Configuration.h"
|
||||||
|
@ -223,8 +223,8 @@ namespace Hurricane {
|
||||||
// );
|
// );
|
||||||
|
|
||||||
// Rotate the painter for the cartouche if in A4+Landscape mode.
|
// Rotate the painter for the cartouche if in A4+Landscape mode.
|
||||||
if ( (_printer->paperSize () == QPrinter::A4)
|
if ( (_printer->pageLayout().pageSize().id() == QPageSize::A4)
|
||||||
and (_printer->orientation() == QPrinter::Landscape) ) {
|
and (_printer->pageLayout().orientation() == QPageLayout::Landscape) ) {
|
||||||
painter.translate ( _paperWidth - frameMargin(), frameMargin() );
|
painter.translate ( _paperWidth - frameMargin(), frameMargin() );
|
||||||
painter.rotate ( -90 );
|
painter.rotate ( -90 );
|
||||||
} else
|
} else
|
||||||
|
@ -326,7 +326,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
_printer = printer;
|
_printer = printer;
|
||||||
_printer->setResolution ( _dpi );
|
_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 ();
|
_paperWidth = _printer->width ();
|
||||||
_paperHeight = _printer->height ();
|
_paperHeight = _printer->height ();
|
||||||
|
@ -336,7 +336,7 @@ namespace Hurricane {
|
||||||
_ypaper = (imageOnly) ? 0 : frameMargin();
|
_ypaper = (imageOnly) ? 0 : frameMargin();
|
||||||
|
|
||||||
// Substract the cartouche size only for A4 format.
|
// Substract the cartouche size only for A4 format.
|
||||||
if ( _printer->orientation() == QPrinter::Landscape ) {
|
if ( _printer->pageLayout().orientation() == QPageLayout::Landscape ) {
|
||||||
_drawingWidth -= cartoucheHeight();
|
_drawingWidth -= cartoucheHeight();
|
||||||
} else {
|
} else {
|
||||||
_drawingHeight -= cartoucheHeight();
|
_drawingHeight -= cartoucheHeight();
|
||||||
|
@ -378,7 +378,7 @@ namespace Hurricane {
|
||||||
//cerr << " (xpaper,ypaper) = (" << _xpaper << "," << _ypaper << ")" << endl;
|
//cerr << " (xpaper,ypaper) = (" << _xpaper << "," << _ypaper << ")" << endl;
|
||||||
//cerr << " (dw,dh) = (" << _drawingWidth << "," << _drawingHeight << ")" << 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 );
|
_cellWidget->copyToPrinter( _xpaper, _ypaper, _printer, cb );
|
||||||
|
|
||||||
_printer = NULL;
|
_printer = NULL;
|
||||||
|
|
Loading…
Reference in New Issue