Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][composer] Add preview modes for composer, allows for previe…
…wing composition in grayscale, monochrome and color blindness simulation modes prior to printing (refs #9886)
- Loading branch information
1 parent
2ce7416
commit 1b49a47
Showing
9 changed files
with
429 additions
and
0 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,39 @@ | ||
/** \ingroup gui | ||
* A graphics effect which can be applied to a widget to simulate various printing and | ||
* color blindness modes. | ||
*/ | ||
class QgsPreviewEffect : QGraphicsEffect | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsgraphicseffect.h" | ||
%End | ||
|
||
public: | ||
enum PreviewMode | ||
{ | ||
PreviewGrayscale, | ||
PreviewMono, | ||
PreviewProtanope, | ||
PreviewDeuteranope | ||
}; | ||
|
||
QgsPreviewEffect( QObject* parent ); | ||
~QgsPreviewEffect(); | ||
|
||
/**Sets the mode for the preview effect, which controls how the effect modifies a widgets appearance. | ||
* @param mode PreviewMode to use to draw the widget | ||
* @note added in 2.3 | ||
* @see mode | ||
*/ | ||
void setMode( PreviewMode mode ); | ||
|
||
/**Returns the mode used for the preview effect. | ||
* @returns PreviewMode currently used by the effect | ||
* @note added in 2.3 | ||
* @see setMode | ||
*/ | ||
PreviewMode mode() const; | ||
|
||
protected: | ||
virtual void draw( QPainter *painter ); | ||
}; |
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
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
Oops, something went wrong.