QGIS API Documentation 3.99.0-Master (26c88405ac0)
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#define SIP_NO_FILE
20
21#include "ui_qgsprocessingdxflayerdetailswidgetbase.h"
22
23#include "qgsdxfexport.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
64 private slots:
65
66 void configureLayer();
67
68 private:
69 void setItemValue( QStandardItem *item, const QVariant &value );
70 QString titleForLayer( const QgsDxfExport::DxfLayer &layer );
71
72 QgsProject *mProject = nullptr;
73 QgsProcessingContext mContext;
74};
75
76
77class GUI_EXPORT QgsProcessingDxfLayersWidget : public QWidget
78{
79 Q_OBJECT
80
81 public:
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 void updateSummaryText();
99
100 QLineEdit *mLineEdit = nullptr;
101 QToolButton *mToolButton = nullptr;
102
103 QVariantList mValue;
104
105 QgsProject *mProject = nullptr;
106
107 friend class TestProcessingGui;
108};
109
110
111class GUI_EXPORT QgsProcessingDxfLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
112{
113 Q_OBJECT
114
115 public:
116 QgsProcessingDxfLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, Qgis::ProcessingMode type = Qgis::ProcessingMode::Standard, QWidget *parent = nullptr );
117
118 // QgsProcessingParameterWidgetFactoryInterface
119 QString parameterType() const override;
120 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type ) override;
121
122 // QgsProcessingParameterWidgetWrapper interface
123 QWidget *createWidget() override SIP_FACTORY;
124 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
125
126 protected:
127 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
128 QVariant widgetValue() const override;
129
130 private:
131 QgsProcessingDxfLayersWidget *mPanel = nullptr;
132
133 friend class TestProcessingGui;
134};
135
137
138#endif // QGSPROCESSINGDXFLAYERSWIDGETWRAPPER_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.
Base class for any widget that can be shown as an inline panel.
An interface for Processing widget wrapper factories.
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