QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
20 // Hack to workaround Qt #5114 by disabling PatternTransform
22 {
23  gccaps = 0;
24  gccaps |= ( QPaintEngine::PrimitiveTransform
25  // | QPaintEngine::PatternTransform
26  | QPaintEngine::PixmapTransform
27  | QPaintEngine::PatternBrush
28  // | QPaintEngine::LinearGradientFill
29  // | QPaintEngine::RadialGradientFill
30  // | QPaintEngine::ConicalGradientFill
31  | QPaintEngine::AlphaBlend
32  // | QPaintEngine::PorterDuff
33  | QPaintEngine::PainterPaths
34  | QPaintEngine::Antialiasing
35  | QPaintEngine::BrushStroke
36  | QPaintEngine::ConstantOpacity
37  | QPaintEngine::MaskedBrush
38  // | QPaintEngine::PerspectiveTransform
39  | QPaintEngine::BlendModes
40  // | QPaintEngine::ObjectBoundingModeGradients
41 #if QT_VERSION >= 0x040500
42  | QPaintEngine::RasterOpModes
43 #endif
44  | QPaintEngine::PaintOutsidePaintEvent
45  );
46 }
47 
48 void QgsPaintEngineHack::fixEngineFlags( QPaintEngine *engine )
49 {
50  if ( !engine )
51  return;
52 
53  QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
54  hack->fixFlags();
55 }