QGIS API Documentation 3.99.0-Master (c22de0620c0)
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
21
22#include "ui_qgsmaskingwidgetbase.h"
23
24#include "qgis_gui.h"
25#include "qgis_sip.h"
26#include "qgspanelwidget.h"
28
29#include <QPointer>
30
31#define SIP_NO_FILE
32
34
42class GUI_EXPORT QgsMaskingWidget : public QgsPanelWidget, private Ui::QgsMaskingWidgetBase
43{
44 Q_OBJECT
45 public:
47 QgsMaskingWidget( QWidget *parent = nullptr );
48
50 void setLayer( QgsVectorLayer *layer );
51
53 void apply();
54
55 private slots:
56
60 void onSelectionChanged();
61
62 private:
63 QPointer< QgsVectorLayer > mLayer;
65 void populate();
66
67 QPointer<QgsMessageBarItem> mMessageBarItem;
68
69 friend class TestQgsMaskingWidget;
70};
71
72
80class SymbolLayerVisitor : public QgsStyleEntityVisitorInterface
81{
82 public:
83 typedef std::function<void( const QgsSymbolLayer * )> SymbolLayerCallback;
84
86 SymbolLayerVisitor( SymbolLayerCallback callback );
87
88 bool visitEnter( const QgsStyleEntityVisitorInterface::Node &node ) override;
89
91 void visitSymbol( const QgsSymbol *symbol, const QString &leafIdentifier );
92
93 bool visit( const QgsStyleEntityVisitorInterface::StyleLeaf &leaf ) override;
94
95 private:
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 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.