Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor QgsPaintEngineHack into core and add python bindings
- Loading branch information
Showing
7 changed files
with
99 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class CORE_EXPORT QgsPaintEngineHack : public QPaintEngine | ||
{ | ||
%TypeHeaderCode | ||
#include <qgspaintenginehack.h> | ||
%End | ||
public: | ||
static void fixEngineFlags( QPaintEngine *engine ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*************************************************************************** | ||
qgspaintenginehack.cpp | ||
Hack paint engine flags | ||
------------------- | ||
begin : July 2012 | ||
copyright : (C) Juergen E. Fischer | ||
email : jef at norbit dot de | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgspaintenginehack.h" | ||
|
||
// Hack to workaround Qt #5114 by disabling PatternTransform | ||
void QgsPaintEngineHack::fixFlags() | ||
{ | ||
gccaps = 0; | ||
gccaps |= ( QPaintEngine::PrimitiveTransform | ||
// | QPaintEngine::PatternTransform | ||
| QPaintEngine::PixmapTransform | ||
| QPaintEngine::PatternBrush | ||
// | QPaintEngine::LinearGradientFill | ||
// | QPaintEngine::RadialGradientFill | ||
// | QPaintEngine::ConicalGradientFill | ||
| QPaintEngine::AlphaBlend | ||
// | QPaintEngine::PorterDuff | ||
| QPaintEngine::PainterPaths | ||
| QPaintEngine::Antialiasing | ||
| QPaintEngine::BrushStroke | ||
| QPaintEngine::ConstantOpacity | ||
| QPaintEngine::MaskedBrush | ||
// | QPaintEngine::PerspectiveTransform | ||
| QPaintEngine::BlendModes | ||
// | QPaintEngine::ObjectBoundingModeGradients | ||
#if QT_VERSION >= 0x040500 | ||
| QPaintEngine::RasterOpModes | ||
#endif | ||
| QPaintEngine::PaintOutsidePaintEvent | ||
); | ||
} | ||
|
||
void QgsPaintEngineHack::fixEngineFlags( QPaintEngine *engine ) | ||
{ | ||
if ( !engine ) | ||
return; | ||
|
||
QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine ); | ||
hack->fixFlags(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*************************************************************************** | ||
qgspaintenginehack.cpp - Hack paint engine flags | ||
------------------------------------------------ | ||
begin : July 2012 | ||
copyright : (C) Juergen E. Fischer | ||
email : jef at norbit dot de | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include <QPaintEngine> | ||
|
||
// Hack to workaround Qt #5114 by disabling PatternTransform | ||
class CORE_EXPORT QgsPaintEngineHack : public QPaintEngine | ||
{ | ||
public: | ||
void fixFlags(); | ||
static void fixEngineFlags( QPaintEngine *engine ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters