QGIS API Documentation
3.8.0-Zanzibar (11aff65)
src
gui
processing
qgsprocessingmaplayercombobox.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsprocessingmaplayercombobox.h
3
-----------------------------
4
begin : June 2019
5
copyright : (C) 2019 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
#ifndef QGSPROCESSINGMAPLAYERCOMBOBOX_H
17
#define QGSPROCESSINGMAPLAYERCOMBOBOX_H
18
19
#include "
qgis.h
"
20
#include "qgis_gui.h"
21
#include <QTreeView>
22
#include "
qgsprocessingtoolboxmodel.h
"
23
#include "
qgsfeatureid.h
"
24
#include "
qgsmimedatautils.h
"
25
#include "
qgsprocessingcontext.h
"
26
27
28
class
QgsMapLayerComboBox
;
29
class
QToolButton;
30
class
QCheckBox;
31
class
QgsProcessingParameterDefinition
;
32
34
41
class
GUI_EXPORT QgsProcessingMapLayerComboBox :
public
QWidget
42
{
43
Q_OBJECT
44
45
public
:
46
50
QgsProcessingMapLayerComboBox(
QgsProcessingParameterDefinition
*parameter, QWidget *parent =
nullptr
);
51
56
void
setLayer(
QgsMapLayer
*layer );
57
67
QgsMapLayer
*currentLayer();
68
77
QString currentText();
78
84
void
setValue(
const
QVariant &value,
QgsProcessingContext
&context );
85
91
QVariant value()
const
;
92
93
signals:
94
98
void
valueChanged();
99
104
void
triggerFileSelection();
105
106
protected
:
107
108
void
dragEnterEvent( QDragEnterEvent *event )
override
;
109
void
dragLeaveEvent( QDragLeaveEvent *event )
override
;
110
void
dropEvent( QDropEvent *event )
override
;
111
112
private
slots:
113
114
void
onLayerChanged(
QgsMapLayer
*layer );
115
void
selectionChanged(
const
QgsFeatureIds
&selected,
const
QgsFeatureIds
&deselected,
bool
clearAndSelect );
116
117
private
:
118
QgsProcessingParameterDefinition
*mParameter =
nullptr
;
119
QgsMapLayerComboBox
*mCombo =
nullptr
;
120
QToolButton *mSelectButton =
nullptr
;
121
QCheckBox *mUseSelectionCheckBox =
nullptr
;
122
bool
mDragActive =
false
;
123
QPointer< QgsMapLayer> mPrevLayer;
124
int
mBlockChangedSignal = 0;
125
QgsMapLayer
*compatibleMapLayerFromMimeData(
const
QMimeData *data,
bool
&incompatibleLayerSelected )
const
;
126
QString compatibleUriFromMimeData(
const
QMimeData *data )
const
;
127
};
128
130
#endif // QGSPROCESSINGMAPLAYERCOMBOBOX_H
QgsMapLayer
Base class for all map layer types.
Definition:
qgsmaplayer.h:78
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition:
qgsfeatureid.h:34
qgsprocessingcontext.h
QgsMapLayerComboBox
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
Definition:
qgsmaplayercombobox.h:34
qgsmimedatautils.h
qgsfeatureid.h
QgsProcessingParameterDefinition
Base class for the definition of processing parameters.
Definition:
qgsprocessingparameters.h:206
qgis.h
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition:
qgsprocessingcontext.h:43
qgsprocessingtoolboxmodel.h
Generated on Sat Jun 22 2019 09:24:07 for QGIS API Documentation by
1.8.13