QGIS API Documentation 4.3.0-Master (0ff9723465c)
Loading...
Searching...
No Matches
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
20#include "ui_qgsprocessingdxflayerdetailswidgetbase.h"
21
22#include "qgsdxfexport.h"
26
27#define SIP_NO_FILE
28
29class QLineEdit;
30class QToolButton;
31
33
34class GUI_EXPORT QgsProcessingDxfLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingDxfLayerDetailsWidget
35{
36 Q_OBJECT
37 public:
38 QgsProcessingDxfLayerDetailsWidget( 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 GUI_EXPORT QgsProcessingDxfLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
51{
52 Q_OBJECT
53
54 public:
58 QgsProcessingDxfLayersPanelWidget( const QVariant &value, QgsProject *project, QWidget *parent SIP_TRANSFERTHIS = nullptr );
59
60 private slots:
61
62 void configureLayer();
63
64 private:
65 void setItemValue( QStandardItem *item, const QVariant &value );
66 QString titleForLayer( const QgsDxfExport::DxfLayer &layer );
67
68 QgsProject *mProject = nullptr;
69 QgsProcessingContext mContext;
70};
71
72
73class GUI_EXPORT QgsProcessingDxfLayersWidget : public QWidget
74{
75 Q_OBJECT
76
77 public:
78 QgsProcessingDxfLayersWidget( QWidget *parent = nullptr );
79
80 QVariant value() const { return mValue; }
81 void setValue( const QVariant &value );
82
83 void setProject( QgsProject *project );
84
85 signals:
86
87 void changed();
88
89 private slots:
90
91 void showDialog();
92
93 private:
94 void updateSummaryText();
95
96 QLineEdit *mLineEdit = nullptr;
97 QToolButton *mToolButton = nullptr;
98
99 QVariantList mValue;
100
101 QgsProject *mProject = nullptr;
102
103 friend class TestProcessingGui;
104};
105
106
107class GUI_EXPORT QgsProcessingDxfLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
108{
109 Q_OBJECT
110
111 public:
112 QgsProcessingDxfLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, Qgis::ProcessingMode type = Qgis::ProcessingMode::Standard, QWidget *parent = nullptr );
113
114 // QgsProcessingParameterWidgetFactoryInterface
115 QString parameterType() const override;
116 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type ) override;
117
118 // QgsProcessingParameterWidgetWrapper interface
119 QWidget *createWidget() override SIP_FACTORY;
120 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
121
122 protected:
123 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
124 QVariant widgetValue() const override;
125
126 private:
127 QgsProcessingDxfLayersWidget *mPanel = nullptr;
128
129 friend class TestProcessingGui;
130};
131
133
134#endif // QGSPROCESSINGDXFLAYERSWIDGETWRAPPER_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3890
@ Standard
Standard (single-run) algorithm mode.
Definition qgis.h:3891
A widget wrapper for Processing parameter value widgets.
Base class for any widget that can be shown as an inline panel.
void changed()
Emitted when the widget state changes.
An interface for Processing widget wrapper factories.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_FACTORY
Definition qgis_sip.h:83