QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
21 #include <QPointer>
22 
23 #include "qgspanelwidget.h"
24 #include "ui_qgsmaskingwidgetbase.h"
25 #include "qgis_sip.h"
26 #include "qgis_gui.h"
27 
28 class QgsMessageBarItem;
29 
37 class GUI_EXPORT QgsMaskingWidget: public QgsPanelWidget, private Ui::QgsMaskingWidgetBase
38 {
39  Q_OBJECT
40  public:
42  QgsMaskingWidget( QWidget *parent = nullptr );
43 
45  void setLayer( QgsVectorLayer *layer );
46 
48  void apply();
49 
50  signals:
52  void widgetChanged();
53 
54  protected:
55 
56  void showEvent( QShowEvent * ) override;
57 
58  private slots:
59 
63  void onSelectionChanged();
64 
65  private:
66  QgsVectorLayer *mLayer = nullptr;
68  void populate();
69 
70  QPointer<QgsMessageBarItem> mMessageBarItem;
71  bool mMustPopulate = false;
72 };
73 
74 #endif
QgsMaskingWidget
Definition: qgsmaskingwidget.h:37
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:29
QgsMessageBarItem
Definition: qgsmessagebaritem.h:38
qgis_sip.h
QgsPanelWidget::widgetChanged
void widgetChanged()
Emitted when the widget state changes.
QgsVectorLayer
Definition: qgsvectorlayer.h:385
qgspanelwidget.h