/
qgsblendmodecombobox.h
89 lines (74 loc) · 2.98 KB
/
qgsblendmodecombobox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/***************************************************************************
qgsblendmodecombobox.h
------------------------
begin : March 21, 2013
copyright : (C) 2013 by Nyall Dawson
email : nyall.dawson@gmail.com
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef QGSBLENDMODECOMBOBOX_H
#define QGSBLENDMODECOMBOBOX_H
#include <QComboBox>
#include "qgis_sip.h"
#include <QPainter> // For QPainter::CompositionMode enum
#include "qgis_gui.h"
/**
* \ingroup gui
* \brief A combobox which lets the user select blend modes from a predefined list
*/
class GUI_EXPORT QgsBlendModeComboBox : public QComboBox
{
Q_OBJECT
public:
//! Constructor for QgsBlendModeComboBox
QgsBlendModeComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
/**
* Returns the selected blend mode.
* \see setBlendMode()
*/
QPainter::CompositionMode blendMode();
/**
* Sets the selected blend mode.
* \see blendMode()
*/
void setBlendMode( QPainter::CompositionMode blendMode );
/**
* Sets whether composition modes which cause clipping are shown in the combo box.
*
* By default, these composition modes (such as QPainter::CompositionMode::CompositionMode_DestinationIn )
* are not shown in the combo box, as they can only be used with predictable results in a limited
* set of circumstances. By setting \a show to TRUE these additional composition modes
* will be shown in the combo box.
*
* \see showClippingModes()
* \since QGIS 3.24
*/
void setShowClippingModes( bool show );
/**
* Returns TRUE if composition modes which cause clipping are shown in the combo box.
*
* By default, these composition modes (such as QPainter::CompositionMode::CompositionMode_DestinationIn )
* are not shown in the combo box, as they can only be used with predictable results in a limited
* set of circumstances.
*
* \see setShowClippingModes()
* \since QGIS 3.24
*/
bool showClippingModes() const;
private:
bool mShowClipModes = false;
public slots:
/**
* Populates the blend mode combo box, and sets up mapping for
* blend modes to combo box indexes
*/
void updateModes();
};
#endif // QGSBLENDMODECOMBOBOX_H