QGIS API Documentation 3.99.0-Master (18a1e75d814)
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
20#include "ui_qgsprocessingvectortilewriterlayerdetailswidgetbase.h"
21
25#include "qgsvectortilewriter.h"
26
27#define SIP_NO_FILE
28
29class QLineEdit;
30class QToolButton;
31
33
34
35class QgsProcessingVectorTileWriteLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingVectorTileWriterLayerDetailsWidget
36{
37 Q_OBJECT
38 public:
39 QgsProcessingVectorTileWriteLayerDetailsWidget( const QVariant &value, QgsProject *project );
40
41 QVariant value() const;
42
43 QDialogButtonBox *buttonBox() { return mButtonBox; }
44
45 private:
46 QgsVectorLayer *mLayer = nullptr;
47 QgsProcessingContext mContext;
48};
49
50
51class QgsProcessingVectorTileWriterLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
52{
53 Q_OBJECT
54
55 public:
59 QgsProcessingVectorTileWriterLayersPanelWidget(
60 const QVariant &value,
61 QgsProject *project,
62 QWidget *parent SIP_TRANSFERTHIS = nullptr
63 );
64
65 private slots:
66
67 void configureLayer();
68 void copyLayer();
69
70 private:
71 void setItemValue( QStandardItem *item, const QVariant &value );
72 QString titleForLayer( const QgsVectorTileWriter::Layer &layer );
73
74 QgsProject *mProject = nullptr;
75 QgsProcessingContext mContext;
76};
77
78
79class QgsProcessingVectorTileWriterLayersWidget : public QWidget
80{
81 Q_OBJECT
82
83 public:
84 QgsProcessingVectorTileWriterLayersWidget( QWidget *parent = nullptr );
85
86 QVariant value() const { return mValue; }
87 void setValue( const QVariant &value );
88
89 void setProject( QgsProject *project );
90
91 signals:
92
93 void changed();
94
95 private slots:
96
97 void showDialog();
98
99 private:
100 void updateSummaryText();
101
102 QLineEdit *mLineEdit = nullptr;
103 QToolButton *mToolButton = nullptr;
104
105 QVariantList mValue;
106
107 QgsProject *mProject = nullptr;
108
109 friend class TestProcessingGui;
110};
111
112
113class QgsProcessingVectorTileWriterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
114{
115 Q_OBJECT
116
117 public:
118 QgsProcessingVectorTileWriterLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, Qgis::ProcessingMode type = Qgis::ProcessingMode::Standard, QWidget *parent = nullptr );
119
120 // QgsProcessingParameterWidgetFactoryInterface
121 QString parameterType() const override;
122 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type ) override;
123
124 // QgsProcessingParameterWidgetWrapper interface
125 QWidget *createWidget() override SIP_FACTORY;
126 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
127
128 protected:
129 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
130 QVariant widgetValue() const override;
131
132 private:
133 QgsProcessingVectorTileWriterLayersWidget *mPanel = nullptr;
134
135 friend class TestProcessingGui;
136};
137
138
140
141#endif // QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3757
@ Standard
Standard (single-run) algorithm mode.
Definition qgis.h:3758
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:113
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_FACTORY
Definition qgis_sip.h:83