QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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( const QVariant &value, QgsProject *project, QWidget *parent SIP_TRANSFERTHIS = nullptr );
60
61 private slots:
62
63 void configureLayer();
64 void copyLayer();
65
66 private:
67 void setItemValue( QStandardItem *item, const QVariant &value );
68 QString titleForLayer( const QgsVectorTileWriter::Layer &layer );
69
70 QgsProject *mProject = nullptr;
71 QgsProcessingContext mContext;
72};
73
74
75class QgsProcessingVectorTileWriterLayersWidget : public QWidget
76{
77 Q_OBJECT
78
79 public:
80 QgsProcessingVectorTileWriterLayersWidget( QWidget *parent = nullptr );
81
82 QVariant value() const { return mValue; }
83 void setValue( const QVariant &value );
84
85 void setProject( QgsProject *project );
86
87 signals:
88
89 void changed();
90
91 private slots:
92
93 void showDialog();
94
95 private:
96 void updateSummaryText();
97
98 QLineEdit *mLineEdit = nullptr;
99 QToolButton *mToolButton = nullptr;
100
101 QVariantList mValue;
102
103 QgsProject *mProject = nullptr;
104
105 friend class TestProcessingGui;
106};
107
108
109class QgsProcessingVectorTileWriterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
110{
111 Q_OBJECT
112
113 public:
114 QgsProcessingVectorTileWriterLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, Qgis::ProcessingMode type = Qgis::ProcessingMode::Standard, QWidget *parent = nullptr );
115
116 // QgsProcessingParameterWidgetFactoryInterface
117 QString parameterType() const override;
118 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type ) override;
119
120 // QgsProcessingParameterWidgetWrapper interface
121 QWidget *createWidget() override SIP_FACTORY;
122 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
123
124 protected:
125 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
126 QVariant widgetValue() const override;
127
128 private:
129 QgsProcessingVectorTileWriterLayersWidget *mPanel = nullptr;
130
131 friend class TestProcessingGui;
132};
133
134
136
137#endif // QGSPROCESSINGVECTORTILEWRITERLAYERSWIDGETWRAPPER_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3786
@ Standard
Standard (single-run) algorithm mode.
Definition qgis.h:3787
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