19 #ifndef QGSPROCESSINGWIDGETWRAPPERIMPL_H
20 #define QGSPROCESSINGWIDGETWRAPPERIMPL_H
27 #include "processing/models/qgsprocessingmodelchildparametersource.h"
29 #include <QAbstractButton>
41 class QgsProcessingMatrixParameterPanel;
63 class QgsProcessingEnumModelerWidget;
64 class QgsProcessingMatrixModelerWidget;
65 class QgsProcessingMapLayerComboBox;
67 class QgsProcessingLayerOutputDestinationWidget;
85 QCheckBox *mDefaultCheckBox =
nullptr;
99 QString parameterType()
const override;
114 QVariant widgetValue() const override;
116 QStringList compatibleParameterTypes() const override;
118 QStringList compatibleOutputTypes() const override;
122 QCheckBox *mCheckBox =
nullptr;
123 QComboBox *mComboBox =
nullptr;
125 friend class TestProcessingGui;
156 QString parameterType()
const override;
170 QVariant widgetValue() const override;
172 QStringList compatibleParameterTypes() const override;
173 QStringList compatibleOutputTypes() const override;
174 QString modelerExpressionFormatString() const override;
179 QCheckBox *mUseProjectCrsCheckBox =
nullptr;
181 friend class TestProcessingGui;
199 QLineEdit *mDefaultLineEdit =
nullptr;
200 QCheckBox *mMultiLineCheckBox =
nullptr;
214 QString parameterType()
const override;
228 QVariant widgetValue() const override;
230 QStringList compatibleParameterTypes() const override;
232 QStringList compatibleOutputTypes() const override;
235 QLineEdit *mLineEdit =
nullptr;
236 QPlainTextEdit *mPlainTextEdit =
nullptr;
238 friend class TestProcessingGui;
252 QString parameterType()
const override;
261 QVariant widgetValue() const override;
263 QStringList compatibleParameterTypes() const override;
265 QStringList compatibleOutputTypes() const override;
270 friend class TestProcessingGui;
287 QComboBox *mTypeComboBox =
nullptr;
288 QLineEdit *mMinLineEdit =
nullptr;
289 QLineEdit *mMaxLineEdit =
nullptr;
290 QLineEdit *mDefaultLineEdit =
nullptr;
305 QString parameterType()
const override;
319 QVariant widgetValue() const override;
321 QStringList compatibleParameterTypes() const override;
323 QStringList compatibleOutputTypes() const override;
332 static
double calculateStep(
double minimum,
double maximum );
334 bool mAllowingNull = false;
336 friend class TestProcessingGui;
353 QComboBox *mParentLayerComboBox =
nullptr;
354 QLineEdit *mMinLineEdit =
nullptr;
355 QLineEdit *mMaxLineEdit =
nullptr;
356 QLineEdit *mDefaultLineEdit =
nullptr;
360 class GUI_EXPORT QgsProcessingDistanceWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
370 QString parameterType()
const override;
383 void setUnitParameterValue( const QVariant &value );
388 QVariant widgetValue() const override;
393 QLabel *mLabel =
nullptr;
394 QWidget *mWarningLabel =
nullptr;
395 QComboBox *mUnitsCombo =
nullptr;
397 friend class TestProcessingGui;
414 QLineEdit *mDefaultLineEdit =
nullptr;
418 class GUI_EXPORT QgsProcessingScaleWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
428 QString parameterType()
const override;
441 QVariant widgetValue() const override;
448 friend class TestProcessingGui;
465 QComboBox *mTypeComboBox =
nullptr;
466 QLineEdit *mMinLineEdit =
nullptr;
467 QLineEdit *mMaxLineEdit =
nullptr;
481 QString parameterType()
const override;
495 QVariant widgetValue() const override;
496 QStringList compatibleParameterTypes() const override;
497 QStringList compatibleOutputTypes() const override;
498 QString modelerExpressionFormatString() const override;
507 int mBlockChangedSignal = 0;
508 bool mAllowingNull = false;
510 friend class TestProcessingGui;
526 QgsProcessingMatrixModelerWidget *mMatrixWidget =
nullptr;
540 QString parameterType()
const override;
554 QVariant widgetValue() const override;
556 QStringList compatibleParameterTypes() const override;
557 QStringList compatibleOutputTypes() const override;
558 QString modelerExpressionFormatString() const override;
562 QgsProcessingMatrixParameterPanel *mMatrixWidget =
nullptr;
564 friend class TestProcessingGui;
580 QComboBox *mTypeComboBox =
nullptr;
581 QComboBox *mFilterComboBox =
nullptr;
596 QString parameterType()
const override;
610 QVariant widgetValue() const override;
612 QStringList compatibleParameterTypes() const override;
614 QStringList compatibleOutputTypes() const override;
615 QString modelerExpressionFormatString() const override;
621 friend class TestProcessingGui;
639 QComboBox *mParentLayerComboBox =
nullptr;
654 QString parameterType()
const override;
671 QVariant widgetValue() const override;
673 QStringList compatibleParameterTypes() const override;
675 QStringList compatibleOutputTypes() const override;
677 QString modelerExpressionFormatString() const override;
686 friend class TestProcessingGui;
690 class GUI_EXPORT QgsProcessingEnumCheckboxPanelWidget : public QWidget
696 QgsProcessingEnumCheckboxPanelWidget( QWidget *parent =
nullptr,
const QgsProcessingParameterEnum *param =
nullptr,
int columns = 2 );
697 QVariant value()
const;
698 void setValue(
const QVariant &value );
706 void showPopupMenu();
713 QMap< QVariant, QAbstractButton * > mButtons;
714 QButtonGroup *mButtonGroup =
nullptr;
716 bool mBlockChangedSignal =
false;
718 friend class TestProcessingGui;
721 class GUI_EXPORT QgsProcessingEnumPanelWidget :
public QWidget
728 QVariant value()
const {
return mValue; }
729 void setValue(
const QVariant &value );
741 void updateSummaryText();
744 QLineEdit *mLineEdit =
nullptr;
745 QToolButton *mToolButton =
nullptr;
749 friend class TestProcessingGui;
765 QgsProcessingEnumModelerWidget *mEnumWidget =
nullptr;
779 QString parameterType()
const override;
793 QVariant widgetValue() const override;
795 QStringList compatibleParameterTypes() const override;
797 QStringList compatibleOutputTypes() const override;
799 QString modelerExpressionFormatString() const override;
802 QComboBox *mComboBox =
nullptr;
803 QgsProcessingEnumPanelWidget *mPanel =
nullptr;
804 QgsProcessingEnumCheckboxPanelWidget *mCheckboxPanel =
nullptr;
806 friend class TestProcessingGui;
821 QString parameterType()
const override;
830 QVariant widgetValue() const override;
833 QStringList compatibleParameterTypes() const override;
835 QStringList compatibleOutputTypes() const override;
837 QString modelerExpressionFormatString() const override;
841 QComboBox *mPlainComboBox =
nullptr;
843 friend class TestProcessingGui;
861 QComboBox *mParentLayoutComboBox =
nullptr;
875 QString parameterType()
const override;
889 void setLayoutParameterValue( const QVariant &value );
895 QVariant widgetValue() const override;
897 QStringList compatibleParameterTypes() const override;
899 QStringList compatibleOutputTypes() const override;
900 QString modelerExpressionFormatString() const override;
904 QLineEdit *mLineEdit =
nullptr;
906 friend class TestProcessingGui;
909 class GUI_EXPORT QgsProcessingPointMapTool : public
QgsMapTool
914 ~QgsProcessingPointMapTool()
override;
915 void deactivate()
override;
918 void keyPressEvent( QKeyEvent *e )
override;
927 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
928 friend class TestProcessingGui;
931 class GUI_EXPORT QgsProcessingPointPanel :
public QWidget
937 QgsProcessingPointPanel( QWidget *parent );
939 void setAllowNull(
bool allowNull );
941 QVariant value()
const;
947 void toggleDialogVisibility(
bool visible );
952 void selectOnCanvas();
959 QToolButton *mButton =
nullptr;
962 QPointer< QgsMapTool > mPrevTool;
963 std::unique_ptr< QgsProcessingPointMapTool > mTool;
964 friend class TestProcessingGui;
981 QLineEdit *mDefaultLineEdit =
nullptr;
995 QString parameterType()
const override;
1006 void setDialog( QDialog *dialog ) override;
1011 QVariant widgetValue() const override;
1013 QStringList compatibleParameterTypes() const override;
1015 QStringList compatibleOutputTypes() const override;
1016 QString modelerExpressionFormatString() const override;
1019 QgsProcessingPointPanel *mPanel =
nullptr;
1020 QLineEdit *mLineEdit =
nullptr;
1021 QDialog *mDialog =
nullptr;
1023 friend class TestProcessingGui;
1039 QLineEdit *mDefaultLineEdit =
nullptr;
1053 QString parameterType()
const override;
1067 QVariant widgetValue() const override;
1069 QStringList compatibleParameterTypes() const override;
1071 QStringList compatibleOutputTypes() const override;
1072 QString modelerExpressionFormatString() const override;
1075 QLineEdit *mLineEdit =
nullptr;
1077 friend class TestProcessingGui;
1107 QString parameterType()
const override;
1118 void setDialog( QDialog *dialog ) override;
1123 QVariant widgetValue() const override;
1125 QStringList compatibleParameterTypes() const override;
1127 QStringList compatibleOutputTypes() const override;
1128 QString modelerExpressionFormatString() const override;
1132 QDialog *mDialog =
nullptr;
1134 friend class TestProcessingGui;
1151 QCheckBox *mAllowOpacity =
nullptr;
1165 QString parameterType()
const override;
1179 QVariant widgetValue() const override;
1181 QStringList compatibleParameterTypes() const override;
1183 QStringList compatibleOutputTypes() const override;
1184 QString modelerExpressionFormatString() const override;
1188 friend class TestProcessingGui;
1206 QLineEdit *mDefaultLineEdit =
nullptr;
1208 QComboBox *mSourceParamComboBox =
nullptr;
1209 QComboBox *mDestParamComboBox =
nullptr;
1227 QString parameterType()
const override;
1242 QVariant widgetValue() const override;
1244 QStringList compatibleParameterTypes() const override;
1246 QStringList compatibleOutputTypes() const override;
1247 QString modelerExpressionFormatString() const override;
1250 void setSourceCrsParameterValue( const QVariant &value );
1251 void setDestinationCrsParameterValue( const QVariant &value );
1255 QLineEdit *mLineEdit =
nullptr;
1258 friend class TestProcessingGui;
1261 class GUI_EXPORT QgsProcessingFieldPanelWidget : public QWidget
1269 void setFields(
const QgsFields &fields );
1271 QgsFields fields()
const {
return mFields; }
1273 QVariant value()
const {
return mValue; }
1274 void setValue(
const QVariant &value );
1286 void updateSummaryText();
1291 QLineEdit *mLineEdit =
nullptr;
1292 QToolButton *mToolButton =
nullptr;
1294 QVariantList mValue;
1296 friend class TestProcessingGui;
1312 QComboBox *mParentLayerComboBox =
nullptr;
1313 QComboBox *mDataTypeComboBox =
nullptr;
1314 QLineEdit *mDefaultLineEdit =
nullptr;
1315 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1316 QCheckBox *mDefaultToAllCheckBox =
nullptr;
1329 QString parameterType()
const override;
1347 QVariant widgetValue() const override;
1349 QStringList compatibleParameterTypes() const override;
1351 QStringList compatibleOutputTypes() const override;
1352 QString modelerExpressionFormatString() const override;
1358 QgsProcessingFieldPanelWidget *mPanel =
nullptr;
1359 QLineEdit *mLineEdit =
nullptr;
1365 friend class TestProcessingGui;
1382 QComboBox *mDefaultComboBox =
nullptr;
1396 QString parameterType()
const override;
1410 QVariant widgetValue() const override;
1412 QStringList compatibleParameterTypes() const override;
1414 QStringList compatibleOutputTypes() const override;
1415 QString modelerExpressionFormatString() const override;
1419 QComboBox *mComboBox =
nullptr;
1421 friend class TestProcessingGui;
1438 QComboBox *mTypeComboBox =
nullptr;
1452 QString parameterType()
const override;
1466 QVariant widgetValue() const override;
1468 QStringList compatibleParameterTypes() const override;
1469 QStringList compatibleOutputTypes() const override;
1470 QString modelerExpressionFormatString() const override;
1478 friend class TestProcessingGui;
1500 QComboBox *mProviderComboBox =
nullptr;
1501 QLineEdit *mDefaultEdit =
nullptr;
1515 QString parameterType()
const override;
1530 QVariant widgetValue() const override;
1532 QStringList compatibleParameterTypes() const override;
1534 QStringList compatibleOutputTypes() const override;
1535 QString modelerExpressionFormatString() const override;
1540 int mBlockSignals = 0;
1542 friend class TestProcessingGui;
1560 QComboBox *mConnectionParamComboBox =
nullptr;
1561 QLineEdit *mDefaultEdit =
nullptr;
1575 QString parameterType()
const override;
1577 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1594 QVariant widgetValue() const override;
1596 QStringList compatibleParameterTypes() const override;
1598 QStringList compatibleOutputTypes() const override;
1599 QString modelerExpressionFormatString() const override;
1604 int mBlockSignals = 0;
1606 friend class TestProcessingGui;
1625 QComboBox *mConnectionParamComboBox =
nullptr;
1626 QComboBox *mSchemaParamComboBox =
nullptr;
1627 QLineEdit *mDefaultEdit =
nullptr;
1641 QString parameterType()
const override;
1643 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1661 QVariant widgetValue() const override;
1663 QStringList compatibleParameterTypes() const override;
1665 QStringList compatibleOutputTypes() const override;
1666 QString modelerExpressionFormatString() const override;
1671 int mBlockSignals = 0;
1672 QString mConnection;
1676 friend class TestProcessingGui;
1705 QString parameterType()
const override;
1719 QVariant widgetValue() const override;
1721 QStringList compatibleParameterTypes() const override;
1723 QStringList compatibleOutputTypes() const override;
1724 QString modelerExpressionFormatString() const override;
1728 QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1729 int mBlockSignals = 0;
1731 friend class TestProcessingGui;
1735 class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1745 QString parameterType()
const override;
1754 QStringList compatibleParameterTypes()
const override;
1756 QStringList compatibleOutputTypes()
const override;
1758 QString modelerExpressionFormatString()
const override;
1779 class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1789 QString parameterType()
const override;
1798 QStringList compatibleParameterTypes()
const override;
1800 QStringList compatibleOutputTypes()
const override;
1802 QString modelerExpressionFormatString()
const override;
1823 class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1833 QString parameterType()
const override;
1842 QStringList compatibleParameterTypes()
const override;
1844 QStringList compatibleOutputTypes()
const override;
1846 QString modelerExpressionFormatString()
const override;
1851 class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1861 QString parameterType()
const override;
1870 QStringList compatibleParameterTypes()
const override;
1872 QStringList compatibleOutputTypes()
const override;
1874 QString modelerExpressionFormatString()
const override;
1879 class GUI_EXPORT QgsProcessingRasterBandPanelWidget :
public QWidget
1887 void setBands(
const QList< int > &bands );
1888 void setBandNames(
const QHash<int, QString > &names );
1889 QList< int > bands()
const {
return mBands; }
1891 QVariant value()
const {
return mValue; }
1892 void setValue(
const QVariant &value );
1904 void updateSummaryText();
1906 QList< int > mBands;
1907 QHash<int, QString > mBandNames;
1910 QLineEdit *mLineEdit =
nullptr;
1911 QToolButton *mToolButton =
nullptr;
1913 QVariantList mValue;
1915 friend class TestProcessingGui;
1931 QComboBox *mParentLayerComboBox =
nullptr;
1932 QLineEdit *mDefaultLineEdit =
nullptr;
1933 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1946 QString parameterType()
const override;
1964 QVariant widgetValue() const override;
1966 QStringList compatibleParameterTypes() const override;
1968 QStringList compatibleOutputTypes() const override;
1969 QString modelerExpressionFormatString() const override;
1974 QgsProcessingRasterBandPanelWidget *mPanel =
nullptr;
1975 QLineEdit *mLineEdit =
nullptr;
1979 friend class TestProcessingGui;
1984 class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
1992 QVariant value()
const {
return mValue; }
1993 void setValue(
const QVariant &value );
1996 void setModel( QgsProcessingModelAlgorithm *model,
const QString &modelChildAlgorithmID );
2008 void updateSummaryText();
2011 QLineEdit *mLineEdit =
nullptr;
2012 QToolButton *mToolButton =
nullptr;
2014 QVariantList mValue;
2015 QList< QgsProcessingModelChildParameterSource > mModelSources;
2016 QgsProcessingModelAlgorithm *mModel =
nullptr;
2020 friend class TestProcessingGui;
2036 QComboBox *mLayerTypeComboBox =
nullptr;
2049 QString parameterType()
const override;
2064 QVariant widgetValue() const override;
2066 QStringList compatibleParameterTypes() const override;
2068 QStringList compatibleOutputTypes() const override;
2069 QString modelerExpressionFormatString() const override;
2073 QgsProcessingMultipleLayerPanelWidget *mPanel =
nullptr;
2075 friend class TestProcessingGui;
2094 QVariant widgetValue() const override;
2095 QVariantMap customProperties() const override;
2097 QStringList compatibleParameterTypes() const override;
2099 QStringList compatibleOutputTypes() const override;
2103 QgsProcessingLayerOutputDestinationWidget *mOutputWidget =
nullptr;
2104 int mBlockSignals = 0;
2106 friend class TestProcessingGui;
2110 class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2120 QString parameterType()
const override;
2124 QString modelerExpressionFormatString()
const override;
2131 class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2141 QString parameterType()
const override;
2145 QString modelerExpressionFormatString()
const override;
2149 class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2159 QString parameterType()
const override;
2163 QString modelerExpressionFormatString()
const override;
2167 class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2177 QString parameterType()
const override;
2181 QString modelerExpressionFormatString()
const override;
2185 class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2195 QString parameterType()
const override;
2199 QString modelerExpressionFormatString()
const override;
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.
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.
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.
Helper functions for various unit types.
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