QGIS API Documentation 3.41.0-Master (cea29feecf2)
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:
58 QgsProcessingVectorTileWriterLayersPanelWidget(
59 const QVariant &value,
60 QgsProject *project,
61 QWidget *parent SIP_TRANSFERTHIS = nullptr
62 );
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
78class QgsProcessingVectorTileWriterLayersWidget : public QWidget
79{
80 Q_OBJECT
81
82 public:
83 QgsProcessingVectorTileWriterLayersWidget( QWidget *parent = nullptr );
84
85 QVariant value() const { return mValue; }
86 void setValue( const QVariant &value );
87
88 void setProject( QgsProject *project );
89
90 signals:
91
92 void changed();
93
94 private slots:
95
96 void showDialog();
97
98 private:
99 void updateSummaryText();
100
101 QLineEdit *mLineEdit = nullptr;
102 QToolButton *mToolButton = nullptr;
103
104 QVariantList mValue;
105
106 QgsProject *mProject = nullptr;
107
108 friend class TestProcessingGui;
109};
110
111
112class QgsProcessingVectorTileWriterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
113{
114 Q_OBJECT
115
116 public:
117 QgsProcessingVectorTileWriterLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
118
119 // QgsProcessingParameterWidgetFactoryInterface
120 QString parameterType() const override;
122
123 // QgsProcessingParameterWidgetWrapper interface
124 QWidget *createWidget() override SIP_FACTORY;
125 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
126
127 protected:
128 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
129 QVariant widgetValue() const override;
130
131 QStringList compatibleParameterTypes() const override;
132 QStringList compatibleOutputTypes() const override;
133
134 private:
135 QgsProcessingVectorTileWriterLayersWidget *mPanel = nullptr;
136
137 friend class TestProcessingGui;
138};
139
140
142
143#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