|
40 | 40 | #include "qgslegendmodel.h"
|
41 | 41 | #include "qgscomposerlegenditem.h"
|
42 | 42 | #include "qgslogger.h"
|
| 43 | +#include "qgspaintenginehack.h" |
| 44 | + |
43 | 45 | #include <QImage>
|
44 | 46 | #include <QPainter>
|
45 | 47 | #include <QStringList>
|
@@ -505,38 +507,6 @@ QDomDocument QgsWMSServer::getStyle()
|
505 | 507 | return mConfigParser->getStyle( styleName, layerName );
|
506 | 508 | }
|
507 | 509 |
|
508 |
| -// Hack to workaround Qt #5114 by disabling PatternTransform |
509 |
| -class QgsPaintEngineHack : public QPaintEngine |
510 |
| -{ |
511 |
| - public: |
512 |
| - void fixFlags() |
513 |
| - { |
514 |
| - gccaps = 0; |
515 |
| - gccaps |= ( QPaintEngine::PrimitiveTransform |
516 |
| - // | QPaintEngine::PatternTransform |
517 |
| - | QPaintEngine::PixmapTransform |
518 |
| - | QPaintEngine::PatternBrush |
519 |
| - // | QPaintEngine::LinearGradientFill |
520 |
| - // | QPaintEngine::RadialGradientFill |
521 |
| - // | QPaintEngine::ConicalGradientFill |
522 |
| - | QPaintEngine::AlphaBlend |
523 |
| - // | QPaintEngine::PorterDuff |
524 |
| - | QPaintEngine::PainterPaths |
525 |
| - | QPaintEngine::Antialiasing |
526 |
| - | QPaintEngine::BrushStroke |
527 |
| - | QPaintEngine::ConstantOpacity |
528 |
| - | QPaintEngine::MaskedBrush |
529 |
| - // | QPaintEngine::PerspectiveTransform |
530 |
| - | QPaintEngine::BlendModes |
531 |
| - // | QPaintEngine::ObjectBoundingModeGradients |
532 |
| -#if QT_VERSION >= 0x040500 |
533 |
| - | QPaintEngine::RasterOpModes |
534 |
| -#endif |
535 |
| - | QPaintEngine::PaintOutsidePaintEvent |
536 |
| - ); |
537 |
| - } |
538 |
| -}; |
539 |
| - |
540 | 510 | QByteArray* QgsWMSServer::getPrint( const QString& formatString )
|
541 | 511 | {
|
542 | 512 | QStringList layersList, stylesList, layerIdList;
|
@@ -632,12 +602,7 @@ QByteArray* QgsWMSServer::getPrint( const QString& formatString )
|
632 | 602 | QRectF paperRectMM = printer.pageRect( QPrinter::Millimeter );
|
633 | 603 | QRectF paperRectPixel = printer.pageRect( QPrinter::DevicePixel );
|
634 | 604 |
|
635 |
| - QPaintEngine *engine = printer.paintEngine(); |
636 |
| - if ( engine ) |
637 |
| - { |
638 |
| - QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine ); |
639 |
| - hack->fixFlags(); |
640 |
| - } |
| 605 | + QgsPaintEngineHack::fixEngineFlags( printer.paintEngine() ); |
641 | 606 |
|
642 | 607 | QPainter p( &printer );
|
643 | 608 | if ( c->printAsRaster() ) //embed one raster into the pdf
|
|
0 commit comments