QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmasksourceselectionwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmasksourceselectionwidget.h
3 ---------------------
4 begin : September 2019
5 copyright : (C) 2019 by Hugo Mercier
6 email : hugo dot mercier at oslandia 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#ifndef QGSMASKSOURCESELECTIONWIDGET_H
16#define QGSMASKSOURCESELECTIONWIDGET_H
17
18// We don't want to expose this in the public API
19#define SIP_NO_FILE
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
24
25#include <QWidget>
26
27class QTreeWidget;
28class QTreeWidgetItem;
29class QgsSymbolLayer;
30
39class GUI_EXPORT QgsMaskSourceSelectionWidget : public QWidget
40{
41 Q_OBJECT
42 public:
44 {
46 QString layerId;
47
49 bool isLabeling = false;
50
53 };
54
56 explicit QgsMaskSourceSelectionWidget( QWidget *parent = nullptr );
57
59 void update();
60
62 QList<MaskSource> selection() const;
63
65 void setSelection( const QList<MaskSource> &sel );
66
67 signals:
69 void changed();
70
71 private:
72 QTreeWidget *mTree;
73 QHash<QgsSymbolLayerReference, QTreeWidgetItem *> mItems;
74
76};
77
78#endif
void setSelection(const QList< MaskSource > &sel)
Sets the symbol layer selection.
void changed()
Emitted when an item was changed.
void update()
Updates the possible sources, from the project layers.
QList< MaskSource > selection() const
Returns the current selection.
QgsMaskSourceSelectionWidget(QWidget *parent=nullptr)
constructor
Abstract base class for symbol layers.
bool isLabeling
Whether it is a labeling mask or not.