23#include <QAbstractItemView>
31 setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLengthWithIcon );
43 addItem( tr(
"Normal" ),
static_cast< int >( QgsPainting::BlendMode::BlendNormal ) );
44 insertSeparator( count() );
45 addItem( tr(
"Lighten" ),
static_cast< int >( QgsPainting::BlendMode::BlendLighten ) );
46 addItem( tr(
"Screen" ),
static_cast< int >( QgsPainting::BlendMode::BlendScreen ) );
47 addItem( tr(
"Dodge" ),
static_cast< int >( QgsPainting::BlendMode::BlendDodge ) );
48 addItem( tr(
"Addition" ),
static_cast< int >( QgsPainting::BlendMode::BlendAddition ) );
49 insertSeparator( count() );
50 addItem( tr(
"Darken" ),
static_cast< int >( QgsPainting::BlendMode::BlendDarken ) );
51 addItem( tr(
"Multiply" ),
static_cast< int >( QgsPainting::BlendMode::BlendMultiply ) );
52 addItem( tr(
"Burn" ),
static_cast< int >( QgsPainting::BlendMode::BlendBurn ) );
53 insertSeparator( count() );
54 addItem( tr(
"Overlay" ),
static_cast< int >( QgsPainting::BlendMode::BlendOverlay ) );
55 addItem( tr(
"Soft Light" ),
static_cast< int >( QgsPainting::BlendMode::BlendSoftLight ) );
56 addItem( tr(
"Hard Light" ),
static_cast< int >( QgsPainting::BlendMode::BlendHardLight ) );
57 insertSeparator( count() );
58 addItem( tr(
"Difference" ),
static_cast< int >( QgsPainting::BlendMode::BlendDifference ) );
59 addItem( tr(
"Subtract" ),
static_cast< int >( QgsPainting::BlendMode::BlendSubtract ) );
63 insertSeparator( count() );
64 addItem( tr(
"Masked By Below" ),
static_cast< int >( QgsPainting::BlendMode::BlendSourceIn ) );
65 addItem( tr(
"Mask Below" ),
static_cast< int >( QgsPainting::BlendMode::BlendDestinationIn ) );
66 addItem( tr(
"Inverse Masked By Below" ),
static_cast< int >( QgsPainting::BlendMode::BlendSourceOut ) );
67 addItem( tr(
"Inverse Mask Below" ),
static_cast< int >( QgsPainting::BlendMode::BlendDestinationOut ) );
68 addItem( tr(
"Paint Inside Below" ),
static_cast< int >( QgsPainting::BlendMode::BlendSourceAtop ) );
69 addItem( tr(
"Paint Below Inside" ),
static_cast< int >( QgsPainting::BlendMode::BlendDestinationAtop ) );
72 blockSignals(
false );
87 mShowClipModes = show;
88 const QPainter::CompositionMode mode =
blendMode();
96 return mShowClipModes;
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 QgsPainting::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
static QPainter::CompositionMode getCompositionMode(QgsPainting::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer.