QGIS API Documentation  master-6227475
src/core/qgspaintenginehack.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002   qgspaintenginehack.cpp
00003   Hack paint engine flags
00004   -------------------
00005          begin                : July 2012
00006          copyright            : (C) Juergen E. Fischer
00007          email                : jef at norbit dot de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "qgspaintenginehack.h"
00019 
00020 // Hack to workaround Qt #5114 by disabling PatternTransform
00021 void QgsPaintEngineHack::fixFlags()
00022 {
00023   gccaps = 0;
00024   gccaps |= ( QPaintEngine::PrimitiveTransform
00025               // | QPaintEngine::PatternTransform
00026               | QPaintEngine::PixmapTransform
00027               | QPaintEngine::PatternBrush
00028               // | QPaintEngine::LinearGradientFill
00029               // | QPaintEngine::RadialGradientFill
00030               // | QPaintEngine::ConicalGradientFill
00031               | QPaintEngine::AlphaBlend
00032               // | QPaintEngine::PorterDuff
00033               | QPaintEngine::PainterPaths
00034               | QPaintEngine::Antialiasing
00035               | QPaintEngine::BrushStroke
00036               | QPaintEngine::ConstantOpacity
00037               | QPaintEngine::MaskedBrush
00038               // | QPaintEngine::PerspectiveTransform
00039               | QPaintEngine::BlendModes
00040               // | QPaintEngine::ObjectBoundingModeGradients
00041 #if QT_VERSION >= 0x040500
00042               | QPaintEngine::RasterOpModes
00043 #endif
00044               | QPaintEngine::PaintOutsidePaintEvent
00045             );
00046 }
00047 
00048 void QgsPaintEngineHack::fixEngineFlags( QPaintEngine *engine )
00049 {
00050   if ( !engine )
00051     return;
00052 
00053   QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
00054   hack->fixFlags();
00055 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines