QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
effects
qgseffectdrawmodecombobox.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgseffectdrawmodecombobox.cpp
3
-----------------------------
4
begin : March 2015
5
copyright : (C) 2015 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgseffectdrawmodecombobox.h
"
17
18
#include "
qgsapplication.h
"
19
20
#include <QList>
21
#include <QPair>
22
23
#include "moc_qgseffectdrawmodecombobox.cpp"
24
25
QgsEffectDrawModeComboBox::QgsEffectDrawModeComboBox
( QWidget *parent )
26
: QComboBox( parent )
27
{
28
QList<QPair<QgsPaintEffect::DrawMode, QString>> modes;
29
modes << qMakePair(
QgsPaintEffect::Render
, tr(
"Render only"
) ) << qMakePair(
QgsPaintEffect::Modifier
, tr(
"Modifier only"
) ) << qMakePair(
QgsPaintEffect::ModifyAndRender
, tr(
"Render and modify"
) );
30
31
for
(
int
i = 0; i < modes.count(); i++ )
32
{
33
const
QgsPaintEffect::DrawMode
mode = modes.at( i ).first;
34
const
QString name = modes.at( i ).second;
35
addItem( name, QVariant( (
int
) mode ) );
36
}
37
}
38
39
QgsPaintEffect::DrawMode
QgsEffectDrawModeComboBox::drawMode
()
const
40
{
41
return
(
QgsPaintEffect::DrawMode
) currentData().toInt();
42
}
43
44
void
QgsEffectDrawModeComboBox::setDrawMode
(
QgsPaintEffect::DrawMode
drawMode
)
45
{
46
const
int
idx = findData( QVariant( (
int
)
drawMode
) );
47
setCurrentIndex( idx == -1 ? 0 : idx );
48
}
QgsEffectDrawModeComboBox::setDrawMode
void setDrawMode(QgsPaintEffect::DrawMode drawMode)
Sets the currently selected draw mode for the combo box.
Definition
qgseffectdrawmodecombobox.cpp:44
QgsEffectDrawModeComboBox::drawMode
QgsPaintEffect::DrawMode drawMode() const
Returns the currently selected draw mode for the combo box.
Definition
qgseffectdrawmodecombobox.cpp:39
QgsEffectDrawModeComboBox::QgsEffectDrawModeComboBox
QgsEffectDrawModeComboBox(QWidget *parent SIP_TRANSFERTHIS=nullptr)
Definition
qgseffectdrawmodecombobox.cpp:25
QgsPaintEffect::DrawMode
DrawMode
Drawing modes for effects.
Definition
qgspainteffect.h:108
QgsPaintEffect::Render
@ Render
The result of the effect is rendered on the destination, but does not affect subsequent effects in th...
Definition
qgspainteffect.h:110
QgsPaintEffect::Modifier
@ Modifier
The result of the effect is not rendered, but is passed on to following effects in the stack.
Definition
qgspainteffect.h:109
QgsPaintEffect::ModifyAndRender
@ ModifyAndRender
The result of the effect is both rendered and passed on to subsequent effects in the stack.
Definition
qgspainteffect.h:111
qgsapplication.h
qgseffectdrawmodecombobox.h
Generated on
for QGIS API Documentation by
1.17.0