QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgssubstitutionlistwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssubstitutionlistwidget.h
3  ---------------------------
4  begin : August 2016
5  copyright : (C) 2016 Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 #ifndef QGSSUBSTITUTIONLISTWIDGET_H
19 #define QGSSUBSTITUTIONLISTWIDGET_H
20 
21 #include <QDialog>
22 #include "qgis_sip.h"
23 #include "qgspanelwidget.h"
24 #include "ui_qgssubstitutionlistwidgetbase.h"
25 #include "qgsstringutils.h"
26 #include "qgis_gui.h"
27 
36 class GUI_EXPORT QgsSubstitutionListWidget : public QgsPanelWidget, private Ui::QgsSubstitutionListWidgetBase
37 {
38  Q_OBJECT
39  Q_PROPERTY( QgsStringReplacementCollection substitutions READ substitutions WRITE setSubstitutions NOTIFY substitutionsChanged )
40 
41  public:
42 
47  QgsSubstitutionListWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
48 
54  void setSubstitutions( const QgsStringReplacementCollection &substitutions );
55 
60  QgsStringReplacementCollection substitutions() const;
61 
62  signals:
63 
66 
67  private slots:
68 
69  void mButtonAdd_clicked();
70  void mButtonRemove_clicked();
71  void tableChanged();
72  void mButtonExport_clicked();
73  void mButtonImport_clicked();
74 
75  private:
76 
77  void addSubstitution( const QgsStringReplacement &substitution );
78 
79 };
80 
89 class GUI_EXPORT QgsSubstitutionListDialog : public QDialog
90 {
91  Q_OBJECT
92  Q_PROPERTY( QgsStringReplacementCollection substitutions READ substitutions WRITE setSubstitutions )
93 
94  public:
95 
100  QgsSubstitutionListDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr );
101 
107  void setSubstitutions( const QgsStringReplacementCollection &substitutions );
108 
113  QgsStringReplacementCollection substitutions() const;
114 
115 
116  private:
117 
118  QgsSubstitutionListWidget *mWidget = nullptr;
119 
120 };
121 
122 #endif // QGSSUBSTITUTIONLISTWIDGET_H
qgsstringutils.h
QgsSubstitutionListWidget::substitutionsChanged
void substitutionsChanged(const QgsStringReplacementCollection &substitutions)
Emitted when the substitution definitions change.
QgsSubstitutionListWidget
A widget which allows users to specify a list of substitutions to apply to a string,...
Definition: qgssubstitutionlistwidget.h:37
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:30
qgis_sip.h
QgsSubstitutionListDialog
A dialog which allows users to specify a list of substitutions to apply to a string,...
Definition: qgssubstitutionlistwidget.h:90
QgsStringReplacement
A representation of a single string replacement.
Definition: qgsstringutils.h:39
QgsStringReplacementCollection
A collection of string replacements (specified using QgsStringReplacement objects).
Definition: qgsstringutils.h:116
qgspanelwidget.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53