QGIS API Documentation 3.39.0-Master (93ce9bf5c90)
Loading...
Searching...
No Matches
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
35class GUI_EXPORT QgsSubstitutionListWidget : public QgsPanelWidget, private Ui::QgsSubstitutionListWidgetBase
36{
37 Q_OBJECT
38 Q_PROPERTY( QgsStringReplacementCollection substitutions READ substitutions WRITE setSubstitutions NOTIFY substitutionsChanged )
39
40 public:
41
46 QgsSubstitutionListWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
47
53 void setSubstitutions( const QgsStringReplacementCollection &substitutions );
54
59 QgsStringReplacementCollection substitutions() const;
60
61 signals:
62
65
66 private slots:
67
68 void mButtonAdd_clicked();
69 void mButtonRemove_clicked();
70 void tableChanged();
71 void mButtonExport_clicked();
72 void mButtonImport_clicked();
73
74 private:
75
76 void addSubstitution( const QgsStringReplacement &substitution );
77
78};
79
87class GUI_EXPORT QgsSubstitutionListDialog : public QDialog
88{
89 Q_OBJECT
90 Q_PROPERTY( QgsStringReplacementCollection substitutions READ substitutions WRITE setSubstitutions )
91
92 public:
93
98 QgsSubstitutionListDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr );
99
105 void setSubstitutions( const QgsStringReplacementCollection &substitutions );
106
111 QgsStringReplacementCollection substitutions() const;
112
113
114 private:
115
116 QgsSubstitutionListWidget *mWidget = nullptr;
117
118};
119
120#endif // QGSSUBSTITUTIONLISTWIDGET_H
Base class for any widget that can be shown as a inline panel.
A collection of string replacements (specified using QgsStringReplacement objects).
A representation of a single string replacement.
A dialog which allows users to specify a list of substitutions to apply to a string,...
A widget which allows users to specify a list of substitutions to apply to a string,...
void substitutionsChanged(const QgsStringReplacementCollection &substitutions)
Emitted when the substitution definitions change.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53