QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsprocessingdxflayerswidgetwrapper.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingdxflayerswidgetwrapper.h
3 ---------------------
4 Date : September 2020
5 Copyright : (C) 2020 by Alexander bruy
6 Email : alexander dot bruy 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 QGSPROCESSINGDXFLAYERSWIDGETWRAPPER_H
17#define QGSPROCESSINGDXFLAYERSWIDGETWRAPPER_H
18
19#define SIP_NO_FILE
20
24#include "qgsdxfexport.h"
25
26#include "ui_qgsprocessingdxflayerdetailswidgetbase.h"
27
28class QLineEdit;
29class QToolButton;
30
32
33class GUI_EXPORT QgsProcessingDxfLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingDxfLayerDetailsWidget
34{
35 Q_OBJECT
36 public:
37 QgsProcessingDxfLayerDetailsWidget( const QVariant &value, QgsProject *project );
38
39 QVariant value() const;
40
41 QDialogButtonBox *buttonBox() { return mButtonBox; }
42
43 private:
44 QgsVectorLayer *mLayer = nullptr;
45 QgsProcessingContext mContext;
46};
47
48
49class GUI_EXPORT QgsProcessingDxfLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
50{
51 Q_OBJECT
52
53 public:
54
58 QgsProcessingDxfLayersPanelWidget(
59 const QVariant &value,
60 QgsProject *project,
61 QWidget *parent SIP_TRANSFERTHIS = nullptr );
62
63 private slots:
64
65 void configureLayer();
66
67 private:
68 void setItemValue( QStandardItem *item, const QVariant &value );
69 QString titleForLayer( const QgsDxfExport::DxfLayer &layer );
70
71 QgsProject *mProject = nullptr;
72 QgsProcessingContext mContext;
73};
74
75
76class GUI_EXPORT QgsProcessingDxfLayersWidget : public QWidget
77{
78 Q_OBJECT
79
80 public:
81
82 QgsProcessingDxfLayersWidget( QWidget *parent = nullptr );
83
84 QVariant value() const { return mValue; }
85 void setValue( const QVariant &value );
86
87 void setProject( QgsProject *project );
88
89 signals:
90
91 void changed();
92
93 private slots:
94
95 void showDialog();
96
97 private:
98
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 GUI_EXPORT QgsProcessingDxfLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
113{
114 Q_OBJECT
115
116 public:
117
118 QgsProcessingDxfLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
119 QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
120
121 // QgsProcessingParameterWidgetFactoryInterface
122 QString parameterType() const override;
124
125 // QgsProcessingParameterWidgetWrapper interface
126 QWidget *createWidget() override SIP_FACTORY;
127 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
128
129 protected:
130
131 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
132 QVariant widgetValue() const override;
133
134 QStringList compatibleParameterTypes() const override;
135 QStringList compatibleOutputTypes() const override;
136
137 private:
138
139 QgsProcessingDxfLayersWidget *mPanel = nullptr;
140
141 friend class TestProcessingGui;
142};
143
145
146#endif // QGSPROCESSINGDXFLAYERSWIDGETWRAPPER_H
A widget wrapper for Processing parameter value widgets.
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.
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.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_FACTORY
Definition: qgis_sip.h:76
Layers and optional attribute index to split into multiple layers using attribute value as layer name...
Definition: qgsdxfexport.h:75