QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsprocessingvectortilewriterlayerswidgetwrapper.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingvectortilewriterlayerswidgetwrapper.h
3 ---------------------
4 Date : April 2020
5 Copyright : (C) 2020 by Martin Dobias
6 Email : wonder dot sk at gmail 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
16#ifndef QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
17#define QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
18
19#define SIP_NO_FILE
20
24#include "qgsvectortilewriter.h"
25
26#include "ui_qgsprocessingvectortilewriterlayerdetailswidgetbase.h"
27
28class QLineEdit;
29class QToolButton;
30
32
33
34class QgsProcessingVectorTileWriteLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingVectorTileWriterLayerDetailsWidget
35{
36 Q_OBJECT
37 public:
38 QgsProcessingVectorTileWriteLayerDetailsWidget( const QVariant &value, QgsProject *project );
39
40 QVariant value() const;
41
42 QDialogButtonBox *buttonBox() { return mButtonBox; }
43
44 private:
45 QgsVectorLayer *mLayer = nullptr;
46 QgsProcessingContext mContext;
47};
48
49
50class QgsProcessingVectorTileWriterLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
51{
52 Q_OBJECT
53
54 public:
55
59 QgsProcessingVectorTileWriterLayersPanelWidget(
60 const QVariant &value,
61 QgsProject *project,
62 QWidget *parent SIP_TRANSFERTHIS = nullptr );
63
64 private slots:
65
66 void configureLayer();
67 void copyLayer();
68
69 private:
70 void setItemValue( QStandardItem *item, const QVariant &value );
71 QString titleForLayer( const QgsVectorTileWriter::Layer &layer );
72
73 QgsProject *mProject = nullptr;
74 QgsProcessingContext mContext;
75};
76
77
78
79class QgsProcessingVectorTileWriterLayersWidget : public QWidget
80{
81 Q_OBJECT
82
83 public:
84
85 QgsProcessingVectorTileWriterLayersWidget( QWidget *parent = nullptr );
86
87 QVariant value() const { return mValue; }
88 void setValue( const QVariant &value );
89
90 void setProject( QgsProject *project );
91
92 signals:
93
94 void changed();
95
96 private slots:
97
98 void showDialog();
99
100 private:
101
102 void updateSummaryText();
103
104 QLineEdit *mLineEdit = nullptr;
105 QToolButton *mToolButton = nullptr;
106
107 QVariantList mValue;
108
109 QgsProject *mProject = nullptr;
110
111 friend class TestProcessingGui;
112};
113
114
115class QgsProcessingVectorTileWriterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
116{
117 Q_OBJECT
118
119 public:
120
121 QgsProcessingVectorTileWriterLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
122 QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
123
124 // QgsProcessingParameterWidgetFactoryInterface
125 QString parameterType() const override;
127
128 // QgsProcessingParameterWidgetWrapper interface
129 QWidget *createWidget() override SIP_FACTORY;
130 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
131
132 protected:
133
134 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
135 QVariant widgetValue() const override;
136
137 QStringList compatibleParameterTypes() const override;
138 QStringList compatibleOutputTypes() const override;
139
140 private:
141
142 QgsProcessingVectorTileWriterLayersWidget *mPanel = nullptr;
143
144 friend class TestProcessingGui;
145};
146
147
149
150#endif // QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
A widget wrapper for Processing parameter value widgets.
virtual QWidget * createWidget()=0
Creates a new widget which allows customization of the parameter's value.
Base class for any widget that can be shown as a inline panel.
Contains information about the context in which a processing algorithm is executed.
WidgetType
Types of dialogs which Processing widgets can be created for.
@ Standard
Standard algorithm dialog.
Base class for the definition of processing parameters.
Contains settings which reflect the context in which a Processing parameter widget is shown,...
An interface for Processing widget wrapper factories.
virtual QgsAbstractProcessingParameterWidgetWrapper * createWidgetWrapper(const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type)=0
Creates a new widget wrapper for the specified parameter definition.
virtual QString parameterType() const =0
Returns the type string for the parameter type the factory is associated with.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
Represents a vector layer which manages a vector based data sets.
Configuration of a single input vector layer to be included in the output.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_FACTORY
Definition qgis_sip.h:76