Skip to content
Permalink
Browse files

Allow compiling without print support

  • Loading branch information
m-kuhn committed Dec 20, 2016
1 parent dfd9833 commit aa646884fb8517d7c29edb2679656579c3f2e9df
@@ -2777,6 +2777,8 @@ void QgsComposition::deleteAndRemoveMultiFrames()
mMultiFrames.clear();
}

#ifndef QT_NO_PRINTER

void QgsComposition::beginPrintAsPDF( QPrinter& printer, const QString& file )
{
printer.setOutputFileName( file );
@@ -2808,6 +2810,8 @@ bool QgsComposition::exportAsPDF( const QString& file )
return print( printer );
}

#endif

void QgsComposition::georeferenceOutput( const QString& file, QgsComposerMap* map,
const QRectF& exportRegion, double dpi ) const
{
@@ -2836,6 +2840,8 @@ void QgsComposition::georeferenceOutput( const QString& file, QgsComposerMap* ma
delete[] t;
}

#ifndef QT_NO_PRINTER

void QgsComposition::doPrint( QPrinter& printer, QPainter& p, bool startNewPage )
{
if ( ddPageSizeActive() )
@@ -2929,6 +2935,8 @@ bool QgsComposition::print( QPrinter &printer, const bool evaluateDDPageSize )
return true;
}

#endif

QImage QgsComposition::printPageAsRaster( int page, QSize imageSize, int dpi )
{
int resolution = mPrintResolution;
@@ -608,8 +608,8 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionCo
void setPreventCursorChange( const bool preventChange ) { mPreventCursorChange = preventChange; }
bool preventCursorChange() const { return mPreventCursorChange; }

#ifndef QT_NO_PRINTER
//printing

//! Prepare the printer for printing
void beginPrint( QPrinter& printer, const bool evaluateDDPageSize = false );
//! Prepare the printer for printing in a PDF
@@ -631,6 +631,7 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionCo
* @returns true if export was successful
*/
bool exportAsPDF( const QString& file );
#endif

/** Renders a composer page to an image.
* @param page page number, 0 based such that the first page is page 0
@@ -268,6 +268,7 @@ void QgsProjectFileTransform::transform0100to0110()
{
if ( ! mDom.isNull() )
{
#ifndef QT_NO_PRINTER
//Change 'outlinewidth' in QgsSymbol
QPrinter myPrinter( QPrinter::ScreenResolution );
int screenDpi = myPrinter.resolution();
@@ -302,6 +303,7 @@ void QgsProjectFileTransform::transform0100to0110()
QDomText newPointSizeText = mDom.createTextNode( QString::number( static_cast< int >( pointSize ) ) );
currentPointSizeElem.replaceChild( newPointSizeText, pointSizeTextNode );
}
#endif
}
}

@@ -18,12 +18,12 @@


#include <QWidget>
#include <QPrinter>

#ifdef WITH_QTWEBKIT
#include <QWebView>
#include <QDesktopWidget>


/** \ingroup core
*/
class CORE_EXPORT QgsWebView : public QWebView
@@ -45,6 +45,8 @@ class CORE_EXPORT QgsWebView : public QWebView
#else
#include "qgswebpage.h"
#include <QTextBrowser>
class QPrinter;


/** \ingroup core
* @brief The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real
@@ -66,6 +66,7 @@ void QgsRasterDrawer::draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsM

QImage img = block->image();

#ifndef QT_NO_PRINTER
// Because of bug in Acrobat Reader we must use "white" transparent color instead
// of "black" for PDF. See #9101.
QPrinter *printer = dynamic_cast<QPrinter *>( p->device() );
@@ -87,6 +88,7 @@ void QgsRasterDrawer::draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsM
}
}
}
#endif

if ( feedback && feedback->renderPartialOutput() )
{

0 comments on commit aa64688

Please sign in to comment.
You can’t perform that action at this time.