QGIS API Documentation 3.39.0-Master (47f7b3a4989)
Loading...
Searching...
No Matches
qgsmaskingwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaskingwidget.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 QGSMASKINGWIDGET_H
16#define QGSMASKINGWIDGET_H
17
18// We don't want to expose this in the public API
19#define SIP_NO_FILE
20
22
23#include <QPointer>
24
25#include "qgspanelwidget.h"
26#include "ui_qgsmaskingwidgetbase.h"
28#include "qgis_sip.h"
29#include "qgis_gui.h"
30
32
40class GUI_EXPORT QgsMaskingWidget: public QgsPanelWidget, private Ui::QgsMaskingWidgetBase
41{
42 Q_OBJECT
43 public:
45 QgsMaskingWidget( QWidget *parent = nullptr );
46
48 void setLayer( QgsVectorLayer *layer );
49
51 void apply();
52
53 private slots:
54
58 void onSelectionChanged();
59
60 private:
61 QgsVectorLayer *mLayer = nullptr;
63 void populate();
64
65 QPointer<QgsMessageBarItem> mMessageBarItem;
66
67 friend class TestQgsMaskingWidget;
68};
69
70
78class SymbolLayerVisitor : public QgsStyleEntityVisitorInterface
79{
80 public:
81 typedef std::function<void( const QgsSymbolLayer *, const QString & )> SymbolLayerCallback;
82
84 SymbolLayerVisitor( SymbolLayerCallback callback );
85
86 bool visitEnter( const QgsStyleEntityVisitorInterface::Node &node ) override;
87
89 void visitSymbol( const QgsSymbol *symbol, const QString &leafIdentifier, QVector<int> rootPath );
90
91 bool visit( const QgsStyleEntityVisitorInterface::StyleLeaf &leaf ) override;
92
93 private:
94 QString mSymbolKey;
95 QList<QPair<QgsSymbolLayerId, QList<QgsSymbolLayerReference>>> mMasks;
96 SymbolLayerCallback mCallback;
97};
98
100
101#endif
Represents an item shown within a QgsMessageBar widget.
Base class for any widget that can be shown as a inline panel.
An interface for classes which can visit style entity (e.g.
virtual bool visitEnter(const QgsStyleEntityVisitorInterface::Node &node)
Called when the visitor starts visiting a node.
virtual bool visit(const QgsStyleEntityVisitorInterface::StyleLeaf &entity)
Called when the visitor will visit a style entity.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:94
Represents a vector layer which manages a vector based data sets.
Contains information relating to a node (i.e.
Contains information relating to the style entity currently being visited.