19#ifndef QGSPROCESSINGWIDGETWRAPPERIMPL_H
20#define QGSPROCESSINGWIDGETWRAPPERIMPL_H
29#include <QAbstractButton>
41class QgsProcessingMatrixParameterPanel;
63class QgsProcessingEnumModelerWidget;
64class QgsProcessingMatrixModelerWidget;
65class QgsProcessingMapLayerComboBox;
67class QgsProcessingLayerOutputDestinationWidget;
86 QCheckBox *mDefaultCheckBox =
nullptr;
100 QString parameterType()
const override;
115 QVariant widgetValue() const override;
117 QStringList compatibleParameterTypes() const override;
119 QStringList compatibleOutputTypes() const override;
123 QCheckBox *mCheckBox =
nullptr;
124 QComboBox *mComboBox =
nullptr;
126 friend class TestProcessingGui;
157 QString parameterType()
const override;
171 QVariant widgetValue() const override;
173 QStringList compatibleParameterTypes() const override;
174 QStringList compatibleOutputTypes() const override;
175 QString modelerExpressionFormatString() const override;
180 QCheckBox *mUseProjectCrsCheckBox =
nullptr;
182 friend class TestProcessingGui;
200 QLineEdit *mDefaultLineEdit =
nullptr;
201 QCheckBox *mMultiLineCheckBox =
nullptr;
215 QString parameterType()
const override;
229 QVariant widgetValue() const override;
231 QStringList compatibleParameterTypes() const override;
233 QStringList compatibleOutputTypes() const override;
236 QLineEdit *mLineEdit =
nullptr;
237 QComboBox *mComboBox =
nullptr;
238 QPlainTextEdit *mPlainTextEdit =
nullptr;
240 friend class TestProcessingGui;
254 QString parameterType()
const override;
263 QVariant widgetValue() const override;
265 QStringList compatibleParameterTypes() const override;
267 QStringList compatibleOutputTypes() const override;
272 friend class TestProcessingGui;
289 QComboBox *mTypeComboBox =
nullptr;
290 QLineEdit *mMinLineEdit =
nullptr;
291 QLineEdit *mMaxLineEdit =
nullptr;
292 QLineEdit *mDefaultLineEdit =
nullptr;
307 QString parameterType()
const override;
321 QVariant widgetValue() const override;
323 QStringList compatibleParameterTypes() const override;
325 QStringList compatibleOutputTypes() const override;
334 static
double calculateStep(
double minimum,
double maximum );
336 bool mAllowingNull = false;
338 friend class TestProcessingGui;
355 QComboBox *mParentLayerComboBox =
nullptr;
356 QLineEdit *mMinLineEdit =
nullptr;
357 QLineEdit *mMaxLineEdit =
nullptr;
358 QLineEdit *mDefaultLineEdit =
nullptr;
362class GUI_EXPORT QgsProcessingDistanceWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
372 QString parameterType()
const override;
385 void setUnitParameterValue( const QVariant &value );
386 void setUnits(
Qgis::DistanceUnit unit );
390 QVariant widgetValue() const override;
394 Qgis::DistanceUnit mBaseUnit =
Qgis::DistanceUnit::Unknown;
395 QLabel *mLabel =
nullptr;
396 QWidget *mWarningLabel =
nullptr;
397 QComboBox *mUnitsCombo =
nullptr;
399 friend class TestProcessingGui;
416 QLineEdit *mMinLineEdit =
nullptr;
417 QLineEdit *mMaxLineEdit =
nullptr;
418 QLineEdit *mDefaultLineEdit =
nullptr;
419 QComboBox *mUnitsCombo =
nullptr;
423class GUI_EXPORT QgsProcessingDurationWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
433 QString parameterType()
const override;
447 QVariant widgetValue() const override;
452 Qgis::TemporalUnit mBaseUnit =
Qgis::TemporalUnit::Milliseconds;
453 QComboBox *mUnitsCombo =
nullptr;
455 friend class TestProcessingGui;
471 QLineEdit *mDefaultLineEdit =
nullptr;
475class GUI_EXPORT QgsProcessingScaleWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
485 QString parameterType()
const override;
498 QVariant widgetValue() const override;
505 friend class TestProcessingGui;
522 QComboBox *mTypeComboBox =
nullptr;
523 QLineEdit *mMinLineEdit =
nullptr;
524 QLineEdit *mMaxLineEdit =
nullptr;
538 QString parameterType()
const override;
552 QVariant widgetValue() const override;
553 QStringList compatibleParameterTypes() const override;
554 QStringList compatibleOutputTypes() const override;
555 QString modelerExpressionFormatString() const override;
564 int mBlockChangedSignal = 0;
565 bool mAllowingNull = false;
567 friend class TestProcessingGui;
583 QgsProcessingMatrixModelerWidget *mMatrixWidget =
nullptr;
597 QString parameterType()
const override;
611 QVariant widgetValue() const override;
613 QStringList compatibleParameterTypes() const override;
614 QStringList compatibleOutputTypes() const override;
615 QString modelerExpressionFormatString() const override;
619 QgsProcessingMatrixParameterPanel *mMatrixWidget =
nullptr;
621 friend class TestProcessingGui;
637 QComboBox *mTypeComboBox =
nullptr;
638 QComboBox *mFilterComboBox =
nullptr;
653 QString parameterType()
const override;
667 QVariant widgetValue() const override;
669 QStringList compatibleParameterTypes() const override;
671 QStringList compatibleOutputTypes() const override;
672 QString modelerExpressionFormatString() const override;
678 friend class TestProcessingGui;
696 QComboBox *mParentLayerComboBox =
nullptr;
711 QString parameterType()
const override;
729 QVariant widgetValue() const override;
731 QStringList compatibleParameterTypes() const override;
733 QStringList compatibleOutputTypes() const override;
735 QString modelerExpressionFormatString() const override;
744 friend class TestProcessingGui;
748class GUI_EXPORT QgsProcessingEnumCheckboxPanelWidget : public QWidget
754 QgsProcessingEnumCheckboxPanelWidget( QWidget *parent =
nullptr,
const QgsProcessingParameterEnum *param =
nullptr,
int columns = 2 );
755 QVariant value()
const;
756 void setValue(
const QVariant &value );
764 void showPopupMenu();
771 QMap< QVariant, QAbstractButton * > mButtons;
772 QButtonGroup *mButtonGroup =
nullptr;
774 bool mBlockChangedSignal =
false;
776 friend class TestProcessingGui;
779class GUI_EXPORT QgsProcessingEnumPanelWidget :
public QWidget
786 QVariant value()
const {
return mValue; }
787 void setValue(
const QVariant &value );
799 void updateSummaryText();
802 QLineEdit *mLineEdit =
nullptr;
803 QToolButton *mToolButton =
nullptr;
807 friend class TestProcessingGui;
823 QgsProcessingEnumModelerWidget *mEnumWidget =
nullptr;
837 QString parameterType()
const override;
851 QVariant widgetValue() const override;
853 QStringList compatibleParameterTypes() const override;
855 QStringList compatibleOutputTypes() const override;
857 QString modelerExpressionFormatString() const override;
860 QComboBox *mComboBox =
nullptr;
861 QgsProcessingEnumPanelWidget *mPanel =
nullptr;
862 QgsProcessingEnumCheckboxPanelWidget *mCheckboxPanel =
nullptr;
864 friend class TestProcessingGui;
879 QString parameterType()
const override;
888 QVariant widgetValue() const override;
891 QStringList compatibleParameterTypes() const override;
893 QStringList compatibleOutputTypes() const override;
895 QString modelerExpressionFormatString() const override;
899 QComboBox *mPlainComboBox =
nullptr;
901 friend class TestProcessingGui;
919 QComboBox *mParentLayoutComboBox =
nullptr;
933 QString parameterType()
const override;
947 void setLayoutParameterValue( const QVariant &value );
953 QVariant widgetValue() const override;
955 QStringList compatibleParameterTypes() const override;
957 QStringList compatibleOutputTypes() const override;
958 QString modelerExpressionFormatString() const override;
962 QLineEdit *mLineEdit =
nullptr;
964 friend class TestProcessingGui;
967class GUI_EXPORT QgsProcessingPointMapTool : public
QgsMapTool
972 ~QgsProcessingPointMapTool()
override;
973 void deactivate()
override;
976 void keyPressEvent( QKeyEvent *e )
override;
985 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
986 friend class TestProcessingGui;
989class GUI_EXPORT QgsProcessingPointPanel :
public QWidget
995 QgsProcessingPointPanel( QWidget *parent );
997 void setAllowNull(
bool allowNull );
999 QVariant value()
const;
1005 void toggleDialogVisibility(
bool visible );
1010 void selectOnCanvas();
1017 QToolButton *mButton =
nullptr;
1020 QPointer< QgsMapTool > mPrevTool;
1021 std::unique_ptr< QgsProcessingPointMapTool > mTool;
1022 friend class TestProcessingGui;
1039 QLineEdit *mDefaultLineEdit =
nullptr;
1053 QString parameterType()
const override;
1064 void setDialog( QDialog *dialog ) override;
1069 QVariant widgetValue() const override;
1071 QStringList compatibleParameterTypes() const override;
1073 QStringList compatibleOutputTypes() const override;
1074 QString modelerExpressionFormatString() const override;
1077 QgsProcessingPointPanel *mPanel =
nullptr;
1078 QLineEdit *mLineEdit =
nullptr;
1079 QDialog *mDialog =
nullptr;
1081 friend class TestProcessingGui;
1097 QLineEdit *mDefaultLineEdit =
nullptr;
1111 QString parameterType()
const override;
1125 QVariant widgetValue() const override;
1127 QStringList compatibleParameterTypes() const override;
1129 QStringList compatibleOutputTypes() const override;
1130 QString modelerExpressionFormatString() const override;
1133 QLineEdit *mLineEdit =
nullptr;
1135 friend class TestProcessingGui;
1165 QString parameterType()
const override;
1176 void setDialog( QDialog *dialog ) override;
1181 QVariant widgetValue() const override;
1183 QStringList compatibleParameterTypes() const override;
1185 QStringList compatibleOutputTypes() const override;
1186 QString modelerExpressionFormatString() const override;
1190 QDialog *mDialog =
nullptr;
1192 friend class TestProcessingGui;
1209 QCheckBox *mAllowOpacity =
nullptr;
1223 QString parameterType()
const override;
1237 QVariant widgetValue() const override;
1239 QStringList compatibleParameterTypes() const override;
1241 QStringList compatibleOutputTypes() const override;
1242 QString modelerExpressionFormatString() const override;
1246 friend class TestProcessingGui;
1264 QLineEdit *mDefaultLineEdit =
nullptr;
1266 QComboBox *mSourceParamComboBox =
nullptr;
1267 QComboBox *mDestParamComboBox =
nullptr;
1285 QString parameterType()
const override;
1300 QVariant widgetValue() const override;
1302 QStringList compatibleParameterTypes() const override;
1304 QStringList compatibleOutputTypes() const override;
1305 QString modelerExpressionFormatString() const override;
1308 void setSourceCrsParameterValue( const QVariant &value );
1309 void setDestinationCrsParameterValue( const QVariant &value );
1313 QLineEdit *mLineEdit =
nullptr;
1316 friend class TestProcessingGui;
1319class GUI_EXPORT QgsProcessingFieldPanelWidget : public QWidget
1327 void setFields(
const QgsFields &fields );
1329 QgsFields fields()
const {
return mFields; }
1331 QVariant value()
const {
return mValue; }
1332 void setValue(
const QVariant &value );
1344 void updateSummaryText();
1349 QLineEdit *mLineEdit =
nullptr;
1350 QToolButton *mToolButton =
nullptr;
1352 QVariantList mValue;
1354 friend class TestProcessingGui;
1370 QComboBox *mParentLayerComboBox =
nullptr;
1371 QComboBox *mDataTypeComboBox =
nullptr;
1372 QLineEdit *mDefaultLineEdit =
nullptr;
1373 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1374 QCheckBox *mDefaultToAllCheckBox =
nullptr;
1387 QString parameterType()
const override;
1405 QVariant widgetValue() const override;
1407 QStringList compatibleParameterTypes() const override;
1409 QStringList compatibleOutputTypes() const override;
1410 QString modelerExpressionFormatString() const override;
1416 QgsProcessingFieldPanelWidget *mPanel =
nullptr;
1417 QLineEdit *mLineEdit =
nullptr;
1423 friend class TestProcessingGui;
1440 QComboBox *mDefaultComboBox =
nullptr;
1454 QString parameterType()
const override;
1468 QVariant widgetValue() const override;
1470 QStringList compatibleParameterTypes() const override;
1472 QStringList compatibleOutputTypes() const override;
1473 QString modelerExpressionFormatString() const override;
1477 QComboBox *mComboBox =
nullptr;
1479 friend class TestProcessingGui;
1496 QComboBox *mTypeComboBox =
nullptr;
1510 QString parameterType()
const override;
1524 QVariant widgetValue() const override;
1526 QStringList compatibleParameterTypes() const override;
1527 QStringList compatibleOutputTypes() const override;
1528 QString modelerExpressionFormatString() const override;
1536 friend class TestProcessingGui;
1558 QComboBox *mProviderComboBox =
nullptr;
1559 QLineEdit *mDefaultEdit =
nullptr;
1573 QString parameterType()
const override;
1588 QVariant widgetValue() const override;
1590 QStringList compatibleParameterTypes() const override;
1592 QStringList compatibleOutputTypes() const override;
1593 QString modelerExpressionFormatString() const override;
1598 int mBlockSignals = 0;
1600 friend class TestProcessingGui;
1618 QComboBox *mConnectionParamComboBox =
nullptr;
1619 QLineEdit *mDefaultEdit =
nullptr;
1633 QString parameterType()
const override;
1635 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1652 QVariant widgetValue() const override;
1654 QStringList compatibleParameterTypes() const override;
1656 QStringList compatibleOutputTypes() const override;
1657 QString modelerExpressionFormatString() const override;
1662 int mBlockSignals = 0;
1664 friend class TestProcessingGui;
1683 QComboBox *mConnectionParamComboBox =
nullptr;
1684 QComboBox *mSchemaParamComboBox =
nullptr;
1685 QLineEdit *mDefaultEdit =
nullptr;
1699 QString parameterType()
const override;
1701 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1719 QVariant widgetValue() const override;
1721 QStringList compatibleParameterTypes() const override;
1723 QStringList compatibleOutputTypes() const override;
1724 QString modelerExpressionFormatString() const override;
1729 int mBlockSignals = 0;
1730 QString mConnection;
1734 friend class TestProcessingGui;
1763 QString parameterType()
const override;
1777 QVariant widgetValue() const override;
1779 QStringList compatibleParameterTypes() const override;
1781 QStringList compatibleOutputTypes() const override;
1782 QString modelerExpressionFormatString() const override;
1787 QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1788 int mBlockSignals = 0;
1790 friend class TestProcessingGui;
1794class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1804 QString parameterType()
const override;
1813 QStringList compatibleParameterTypes()
const override;
1815 QStringList compatibleOutputTypes()
const override;
1817 QString modelerExpressionFormatString()
const override;
1838class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1848 QString parameterType()
const override;
1857 QStringList compatibleParameterTypes()
const override;
1859 QStringList compatibleOutputTypes()
const override;
1861 QString modelerExpressionFormatString()
const override;
1882class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1892 QString parameterType()
const override;
1901 QStringList compatibleParameterTypes()
const override;
1903 QStringList compatibleOutputTypes()
const override;
1905 QString modelerExpressionFormatString()
const override;
1910class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1920 QString parameterType()
const override;
1929 QStringList compatibleParameterTypes()
const override;
1931 QStringList compatibleOutputTypes()
const override;
1933 QString modelerExpressionFormatString()
const override;
1938class GUI_EXPORT QgsProcessingRasterBandPanelWidget :
public QWidget
1946 void setBands(
const QList< int > &bands );
1947 void setBandNames(
const QHash<int, QString > &names );
1948 QList< int > bands()
const {
return mBands; }
1950 QVariant value()
const {
return mValue; }
1951 void setValue(
const QVariant &value );
1963 void updateSummaryText();
1965 QList< int > mBands;
1966 QHash<int, QString > mBandNames;
1969 QLineEdit *mLineEdit =
nullptr;
1970 QToolButton *mToolButton =
nullptr;
1972 QVariantList mValue;
1974 friend class TestProcessingGui;
1990 QComboBox *mParentLayerComboBox =
nullptr;
1991 QLineEdit *mDefaultLineEdit =
nullptr;
1992 QCheckBox *mAllowMultipleCheckBox =
nullptr;
2005 QString parameterType()
const override;
2023 QVariant widgetValue() const override;
2025 QStringList compatibleParameterTypes() const override;
2027 QStringList compatibleOutputTypes() const override;
2028 QString modelerExpressionFormatString() const override;
2033 QgsProcessingRasterBandPanelWidget *mPanel =
nullptr;
2034 QLineEdit *mLineEdit =
nullptr;
2038 friend class TestProcessingGui;
2043class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
2051 QVariant value()
const {
return mValue; }
2052 void setValue(
const QVariant &value );
2055 void setModel( QgsProcessingModelAlgorithm *model,
const QString &modelChildAlgorithmID );
2067 void updateSummaryText();
2070 QLineEdit *mLineEdit =
nullptr;
2071 QToolButton *mToolButton =
nullptr;
2073 QVariantList mValue;
2074 QList< QgsProcessingModelChildParameterSource > mModelSources;
2075 QgsProcessingModelAlgorithm *mModel =
nullptr;
2079 friend class TestProcessingGui;
2095 QComboBox *mLayerTypeComboBox =
nullptr;
2108 QString parameterType()
const override;
2123 QVariant widgetValue() const override;
2125 QStringList compatibleParameterTypes() const override;
2127 QStringList compatibleOutputTypes() const override;
2128 QString modelerExpressionFormatString() const override;
2132 QgsProcessingMultipleLayerPanelWidget *mPanel =
nullptr;
2134 friend class TestProcessingGui;
2153 QVariant widgetValue() const override;
2154 QVariantMap customProperties() const override;
2156 QStringList compatibleParameterTypes() const override;
2158 QStringList compatibleOutputTypes() const override;
2162 QgsProcessingLayerOutputDestinationWidget *mOutputWidget =
nullptr;
2163 int mBlockSignals = 0;
2165 friend class TestProcessingGui;
2169class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2179 QString parameterType()
const override;
2183 QString modelerExpressionFormatString()
const override;
2190class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2200 QString parameterType()
const override;
2204 QString modelerExpressionFormatString()
const override;
2208class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2218 QString parameterType()
const override;
2222 QString modelerExpressionFormatString()
const override;
2226class GUI_EXPORT QgsProcessingPointCloudDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2236 QString parameterType()
const override;
2240 QString modelerExpressionFormatString()
const override;
2244class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2254 QString parameterType()
const override;
2258 QString modelerExpressionFormatString()
const override;
2262class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2272 QString parameterType()
const override;
2276 QString modelerExpressionFormatString()
const override;
2280class GUI_EXPORT QgsProcessingPointCloudLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
2290 QString parameterType()
const override;
2299 QStringList compatibleParameterTypes()
const override;
2301 QStringList compatibleOutputTypes()
const override;
2303 QString modelerExpressionFormatString()
const override;
2318 QString parameterType()
const override;
2331 QVariant widgetValue() const override;
2333 QStringList compatibleParameterTypes() const override;
2335 QStringList compatibleOutputTypes() const override;
2337 QString modelerExpressionFormatString() const override;
2342 int mBlockSignals = 0;
2344 friend class TestProcessingGui;
The Qgis class provides global constants for use throughout the application.
Selector widget for authentication configs.
QComboBox subclass which allows selecting multiple items.
This class represents a coordinate reference system (CRS).
The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific ...
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific da...
The QgsDateEdit class is a QDateEdit widget with the capability of setting/reading null dates.
The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
The QgsExpressionLineEdit widget includes a line edit for entering expressions together with a button...
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
Container of fields for a vector layer.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
The QgsLayoutComboBox class is a combo box which displays available layouts from a QgsLayoutManager.
The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout.
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
A class to represent a 2D point.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Abstract base class for processing algorithms.
An interface for objects which can create Processing contexts.
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.
A raster band parameter for Processing algorithms.
Base class for the definition of processing parameters.
An enum based parameter for processing algorithms, allowing for selection from predefined values.
A vector layer or feature source field parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
Contains settings which reflect the context in which a Processing parameter widget is shown,...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The QgsProviderConnectionComboBox class is a combo box which displays the list of connections registe...
A combobox widget which displays the bands present in a raster layer.
Represents a raster layer.
Class that shows snapping marker on map canvas for the current snapping match.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
The QgsTimeEdit class is a QTimeEdit widget with the capability of setting/reading null date/times.
Represents a vector layer which manages a vector based data sets.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
const QgsCoordinateReferenceSystem & crs