QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgspaintenginehack.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgspaintenginehack.cpp
3 Hack paint engine flags
4 -------------------
5 begin : July 2012
6 copyright : (C) Juergen E. Fischer
7 email : jef at norbit dot de
8
9 ***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include "qgspaintenginehack.h"
19#include "qgsconfig.h"
20
21// Hack to workaround Qt #5114 by disabling PatternTransform
23{
24#if defined(HAS_KDE_QT5_PDF_TRANSFORM_FIX) || QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
25 // not required, fixed upstream
26#else
27 gccaps = PaintEngineFeatures();
28 gccaps |= ( QPaintEngine::PrimitiveTransform
29 // | QPaintEngine::PatternTransform
30 | QPaintEngine::PixmapTransform
31 | QPaintEngine::PatternBrush
32 // | QPaintEngine::LinearGradientFill
33 // | QPaintEngine::RadialGradientFill
34 // | QPaintEngine::ConicalGradientFill
35 | QPaintEngine::AlphaBlend
36 // | QPaintEngine::PorterDuff
37 | QPaintEngine::PainterPaths
38 | QPaintEngine::Antialiasing
39 | QPaintEngine::BrushStroke
40 | QPaintEngine::ConstantOpacity
41 | QPaintEngine::MaskedBrush
42 // | QPaintEngine::PerspectiveTransform
43 | QPaintEngine::BlendModes
44 // | QPaintEngine::ObjectBoundingModeGradients
45 | QPaintEngine::RasterOpModes
46 | QPaintEngine::PaintOutsidePaintEvent
47 );
48#endif
49}
50
51void QgsPaintEngineHack::fixEngineFlags( QPaintEngine *engine )
52{
53#if defined(HAS_KDE_QT5_PDF_TRANSFORM_FIX) || QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
54 // not required, fixed upstream
55 ( void )engine;
56#else
57 if ( !engine )
58 return;
59
60 QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack *>( engine );
61 hack->fixFlags();
62#endif
63}
Hack to workaround Qt #5114 by disabling PatternTransform.
static void fixEngineFlags(QPaintEngine *engine)