QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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 "ui_qgsmaskingwidgetbase.h"
24
25#include "qgis_gui.h"
26#include "qgis_sip.h"
27#include "qgspanelwidget.h"
29
30#include <QPointer>
31
33
41class GUI_EXPORT QgsMaskingWidget : public QgsPanelWidget, private Ui::QgsMaskingWidgetBase
42{
43 Q_OBJECT
44 public:
46 QgsMaskingWidget( QWidget *parent = nullptr );
47
49 void setLayer( QgsVectorLayer *layer );
50
52 void apply();
53
54 private slots:
55
59 void onSelectionChanged();
60
61 private:
62 QgsVectorLayer *mLayer = nullptr;
64 void populate();
65
66 QPointer<QgsMessageBarItem> mMessageBarItem;
67
68 friend class TestQgsMaskingWidget;
69};
70
71
79class SymbolLayerVisitor : public QgsStyleEntityVisitorInterface
80{
81 public:
82 typedef std::function<void( const QgsSymbolLayer *, const QString & )> SymbolLayerCallback;
83
85 SymbolLayerVisitor( SymbolLayerCallback callback );
86
87 bool visitEnter( const QgsStyleEntityVisitorInterface::Node &node ) override;
88
90 void visitSymbol( const QgsSymbol *symbol, const QString &leafIdentifier );
91
92 bool visit( const QgsStyleEntityVisitorInterface::StyleLeaf &leaf ) override;
93
94 private:
95 SymbolLayerCallback mCallback;
96};
97
99
100#endif
Represents an item shown within a QgsMessageBar widget.
Base class for any widget that can be shown as an 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.
Represents a vector layer which manages a vector based dataset.