QGIS API Documentation 4.3.0-Master (16649ce5cc6)
Loading...
Searching...
No Matches
qgsprocessingalignrasterlayerswidgetwrapper.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingalingrasterlayerswidgetwrapper.h
3 ---------------------
4 Date : July 2023
5 Copyright : (C) 2023 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 QGSPROCESSINGALIGNRASTERLAYERSWIDGETWRAPPER_H
17#define QGSPROCESSINGALIGNRASTERLAYERSWIDGETWRAPPER_H
18
19
20#include "ui_qgsprocessingalignrasterlayerdetailswidgetbase.h"
21
22#include "qgsalignrasterdata.h"
26
27#define SIP_NO_FILE
28
29class QLineEdit;
30class QToolButton;
31
33
34class GUI_EXPORT QgsProcessingAlignRasterLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingAlignRasterLayerDetailsWidget
35{
36 Q_OBJECT
37 public:
38 QgsProcessingAlignRasterLayerDetailsWidget( const QVariant &value, QgsProject *project );
39
40 QVariant value() const;
41
42 QDialogButtonBox *buttonBox() { return mButtonBox; }
43
44 private:
45 QgsProcessingContext mContext;
46 QString mInputPath;
47};
48
49
50class GUI_EXPORT QgsProcessingAlignRasterLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
51{
52 Q_OBJECT
53
54 public:
58 QgsProcessingAlignRasterLayersPanelWidget( const QVariant &value, QgsProject *project, QWidget *parent SIP_TRANSFERTHIS = nullptr );
59
60 private slots:
61
62 void configureRaster();
63
64 private:
65 void setItemValue( QStandardItem *item, const QVariant &value );
66 QString titleForItem( const QgsAlignRasterData::RasterItem &item );
67
68 QgsProject *mProject = nullptr;
69 QgsProcessingContext mContext;
70};
71
72
73class GUI_EXPORT QgsProcessingAlignRasterLayersWidget : public QWidget
74{
75 Q_OBJECT
76
77 public:
78 QgsProcessingAlignRasterLayersWidget( 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 QgsProcessingAlignRasterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
108{
109 Q_OBJECT
110
111 public:
112 QgsProcessingAlignRasterLayersWidgetWrapper( 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 QgsProcessingAlignRasterLayersWidget *mPanel = nullptr;
128
129 friend class TestProcessingGui;
130};
131
133
134#endif // QGSPROCESSINGALIGNRASTERLAYERSWIDGETWRAPPER_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