22#include <QAbstractItemView>
30 setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLengthWithIcon );
42 addItem( tr(
"Normal" ),
static_cast< int >( Qgis::BlendMode::Normal ) );
43 insertSeparator( count() );
44 addItem( tr(
"Lighten" ),
static_cast< int >( Qgis::BlendMode::Lighten ) );
45 addItem( tr(
"Screen" ),
static_cast< int >( Qgis::BlendMode::Screen ) );
46 addItem( tr(
"Dodge" ),
static_cast< int >( Qgis::BlendMode::Dodge ) );
47 addItem( tr(
"Addition" ),
static_cast< int >( Qgis::BlendMode::Addition ) );
48 insertSeparator( count() );
49 addItem( tr(
"Darken" ),
static_cast< int >( Qgis::BlendMode::Darken ) );
50 addItem( tr(
"Multiply" ),
static_cast< int >( Qgis::BlendMode::Multiply ) );
51 addItem( tr(
"Burn" ),
static_cast< int >( Qgis::BlendMode::Burn ) );
52 insertSeparator( count() );
53 addItem( tr(
"Overlay" ),
static_cast< int >( Qgis::BlendMode::Overlay ) );
54 addItem( tr(
"Soft Light" ),
static_cast< int >( Qgis::BlendMode::SoftLight ) );
55 addItem( tr(
"Hard Light" ),
static_cast< int >( Qgis::BlendMode::HardLight ) );
56 insertSeparator( count() );
57 addItem( tr(
"Difference" ),
static_cast< int >( Qgis::BlendMode::Difference ) );
58 addItem( tr(
"Subtract" ),
static_cast< int >( Qgis::BlendMode::Subtract ) );
62 insertSeparator( count() );
63 addItem( tr(
"Masked By Below" ),
static_cast< int >( Qgis::BlendMode::SourceIn ) );
64 addItem( tr(
"Mask Below" ),
static_cast< int >( Qgis::BlendMode::DestinationIn ) );
65 addItem( tr(
"Inverse Masked By Below" ),
static_cast< int >( Qgis::BlendMode::SourceOut ) );
66 addItem( tr(
"Inverse Mask Below" ),
static_cast< int >( Qgis::BlendMode::DestinationOut ) );
67 addItem( tr(
"Paint Inside Below" ),
static_cast< int >( Qgis::BlendMode::SourceAtop ) );
68 addItem( tr(
"Paint Below Inside" ),
static_cast< int >( Qgis::BlendMode::DestinationAtop ) );
71 blockSignals(
false );
86 mShowClipModes = show;
87 const QPainter::CompositionMode mode =
blendMode();
95 return mShowClipModes;
BlendMode
Blending modes defining the available composition modes that can be used when painting.
void setBlendMode(QPainter::CompositionMode blendMode)
Sets the selected blend mode.
void setShowClippingModes(bool show)
Sets whether composition modes which cause clipping are shown in the combo box.
QgsBlendModeComboBox(QWidget *parent=nullptr)
Constructor for QgsBlendModeComboBox.
void updateModes()
Populates the blend mode combo box, and sets up mapping for blend modes to combo box indexes.
bool showClippingModes() const
Returns true if composition modes which cause clipping are shown in the combo box.
QPainter::CompositionMode blendMode()
Returns the selected blend mode.
static Qgis::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
static QPainter::CompositionMode getCompositionMode(Qgis::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.