QGIS API Documentation 3.99.0-Master (a8f284845db)
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(
59 const QVariant &value,
60 QgsProject *project,
61 QWidget *parent SIP_TRANSFERTHIS = nullptr
62 );
63
64 private slots:
65
66 void configureRaster();
67
68 private:
69 void setItemValue( QStandardItem *item, const QVariant &value );
70 QString titleForItem( const QgsAlignRasterData::RasterItem &item );
71
72 QgsProject *mProject = nullptr;
73 QgsProcessingContext mContext;
74};
75
76
77class GUI_EXPORT QgsProcessingAlignRasterLayersWidget : public QWidget
78{
79 Q_OBJECT
80
81 public:
82 QgsProcessingAlignRasterLayersWidget( 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 QgsProcessingAlignRasterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
112{
113 Q_OBJECT
114
115 public:
116 QgsProcessingAlignRasterLayersWidgetWrapper( 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 QgsProcessingAlignRasterLayersWidget *mPanel = nullptr;
132
133 friend class TestProcessingGui;
134};
135
137
138#endif // QGSPROCESSINGALIGNRASTERLAYERSWIDGETWRAPPER_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3757
@ Standard
Standard (single-run) algorithm mode.
Definition qgis.h:3758
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:113
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_FACTORY
Definition qgis_sip.h:83