QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
21#include "ui_qgsprocessingvectortilewriterlayerdetailswidgetbase.h"
22
26#include "qgsvectortilewriter.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, Qgis::ProcessingMode type = Qgis::ProcessingMode::Standard, QWidget *parent = nullptr );
118
119 // QgsProcessingParameterWidgetFactoryInterface
120 QString parameterType() const override;
121 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type ) 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 private:
132 QgsProcessingVectorTileWriterLayersWidget *mPanel = nullptr;
133
134 friend class TestProcessingGui;
135};
136
137
139
140#endif // QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3671
@ Standard
Standard (single-run) algorithm mode.
Definition qgis.h:3672
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 an inline panel.
An interface for Processing widget wrapper factories.
virtual QString parameterType() const =0
Returns the type string for the parameter type the factory is associated with.
virtual QgsAbstractProcessingParameterWidgetWrapper * createWidgetWrapper(const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type)=0
Creates a new widget wrapper for the specified parameter definition.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_FACTORY
Definition qgis_sip.h:84