QGIS API Documentation 3.41.0-Master (af5edcb665c)
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#define SIP_NO_FILE
20
24#include "qgsalignrasterdata.h"
25
26#include "ui_qgsprocessingalignrasterlayerdetailswidgetbase.h"
27
28class QLineEdit;
29class QToolButton;
30
32
33class GUI_EXPORT QgsProcessingAlignRasterLayerDetailsWidget : public QgsPanelWidget, private Ui::QgsProcessingAlignRasterLayerDetailsWidget
34{
35 Q_OBJECT
36 public:
37 QgsProcessingAlignRasterLayerDetailsWidget( const QVariant &value, QgsProject *project );
38
39 QVariant value() const;
40
41 QDialogButtonBox *buttonBox() { return mButtonBox; }
42
43 private:
44 QgsProcessingContext mContext;
45 QString mInputPath;
46};
47
48
49class GUI_EXPORT QgsProcessingAlignRasterLayersPanelWidget : public QgsProcessingMultipleSelectionPanelWidget
50{
51 Q_OBJECT
52
53 public:
57 QgsProcessingAlignRasterLayersPanelWidget(
58 const QVariant &value,
59 QgsProject *project,
60 QWidget *parent SIP_TRANSFERTHIS = nullptr
61 );
62
63 private slots:
64
65 void configureRaster();
66
67 private:
68 void setItemValue( QStandardItem *item, const QVariant &value );
69 QString titleForItem( const QgsAlignRasterData::RasterItem &item );
70
71 QgsProject *mProject = nullptr;
72 QgsProcessingContext mContext;
73};
74
75
76class GUI_EXPORT QgsProcessingAlignRasterLayersWidget : public QWidget
77{
78 Q_OBJECT
79
80 public:
81 QgsProcessingAlignRasterLayersWidget( QWidget *parent = nullptr );
82
83 QVariant value() const { return mValue; }
84 void setValue( const QVariant &value );
85
86 void setProject( QgsProject *project );
87
88 signals:
89
90 void changed();
91
92 private slots:
93
94 void showDialog();
95
96 private:
97 void updateSummaryText();
98
99 QLineEdit *mLineEdit = nullptr;
100 QToolButton *mToolButton = nullptr;
101
102 QVariantList mValue;
103
104 QgsProject *mProject = nullptr;
105
106 friend class TestProcessingGui;
107};
108
109
110class GUI_EXPORT QgsProcessingAlignRasterLayersWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
111{
112 Q_OBJECT
113
114 public:
115 QgsProcessingAlignRasterLayersWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr, QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
116
117 // QgsProcessingParameterWidgetFactoryInterface
118 QString parameterType() const override;
120
121 // QgsProcessingParameterWidgetWrapper interface
122 QWidget *createWidget() override SIP_FACTORY;
123 void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
124
125 protected:
126 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
127 QVariant widgetValue() const override;
128
129 QStringList compatibleParameterTypes() const override;
130 QStringList compatibleOutputTypes() const override;
131
132 private:
133 QgsProcessingAlignRasterLayersWidget *mPanel = nullptr;
134
135 friend class TestProcessingGui;
136};
137
139
140#endif // QGSPROCESSINGALIGNRASTERLAYERSWIDGETWRAPPER_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
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_FACTORY
Definition qgis_sip.h:76
Definition of one raster layer for alignment.