19 #ifndef QGSPROCESSINGWIDGETWRAPPERIMPL_H
20 #define QGSPROCESSINGWIDGETWRAPPERIMPL_H
29 #include <QAbstractButton>
41 class QgsProcessingMatrixParameterPanel;
63 class QgsProcessingEnumModelerWidget;
64 class QgsProcessingMatrixModelerWidget;
65 class QgsProcessingMapLayerComboBox;
67 class 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;
362 class GUI_EXPORT QgsProcessingDistanceWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
372 QString parameterType()
const override;
385 void setUnitParameterValue( const QVariant &value );
390 QVariant widgetValue() const override;
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;
423 class GUI_EXPORT QgsProcessingDurationWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
433 QString parameterType()
const override;
447 QVariant widgetValue() const override;
453 QComboBox *mUnitsCombo =
nullptr;
455 friend class TestProcessingGui;
471 QLineEdit *mDefaultLineEdit =
nullptr;
475 class 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;
748 class 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;
779 class 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;
967 class 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;
989 class 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;
1319 class 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;
1786 QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1787 int mBlockSignals = 0;
1789 friend class TestProcessingGui;
1793 class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1803 QString parameterType()
const override;
1812 QStringList compatibleParameterTypes()
const override;
1814 QStringList compatibleOutputTypes()
const override;
1816 QString modelerExpressionFormatString()
const override;
1837 class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1847 QString parameterType()
const override;
1856 QStringList compatibleParameterTypes()
const override;
1858 QStringList compatibleOutputTypes()
const override;
1860 QString modelerExpressionFormatString()
const override;
1881 class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1891 QString parameterType()
const override;
1900 QStringList compatibleParameterTypes()
const override;
1902 QStringList compatibleOutputTypes()
const override;
1904 QString modelerExpressionFormatString()
const override;
1909 class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1919 QString parameterType()
const override;
1928 QStringList compatibleParameterTypes()
const override;
1930 QStringList compatibleOutputTypes()
const override;
1932 QString modelerExpressionFormatString()
const override;
1937 class GUI_EXPORT QgsProcessingRasterBandPanelWidget :
public QWidget
1945 void setBands(
const QList< int > &bands );
1946 void setBandNames(
const QHash<int, QString > &names );
1947 QList< int > bands()
const {
return mBands; }
1949 QVariant value()
const {
return mValue; }
1950 void setValue(
const QVariant &value );
1962 void updateSummaryText();
1964 QList< int > mBands;
1965 QHash<int, QString > mBandNames;
1968 QLineEdit *mLineEdit =
nullptr;
1969 QToolButton *mToolButton =
nullptr;
1971 QVariantList mValue;
1973 friend class TestProcessingGui;
1989 QComboBox *mParentLayerComboBox =
nullptr;
1990 QLineEdit *mDefaultLineEdit =
nullptr;
1991 QCheckBox *mAllowMultipleCheckBox =
nullptr;
2004 QString parameterType()
const override;
2022 QVariant widgetValue() const override;
2024 QStringList compatibleParameterTypes() const override;
2026 QStringList compatibleOutputTypes() const override;
2027 QString modelerExpressionFormatString() const override;
2032 QgsProcessingRasterBandPanelWidget *mPanel =
nullptr;
2033 QLineEdit *mLineEdit =
nullptr;
2037 friend class TestProcessingGui;
2042 class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
2050 QVariant value()
const {
return mValue; }
2051 void setValue(
const QVariant &value );
2054 void setModel( QgsProcessingModelAlgorithm *model,
const QString &modelChildAlgorithmID );
2066 void updateSummaryText();
2069 QLineEdit *mLineEdit =
nullptr;
2070 QToolButton *mToolButton =
nullptr;
2072 QVariantList mValue;
2073 QList< QgsProcessingModelChildParameterSource > mModelSources;
2074 QgsProcessingModelAlgorithm *mModel =
nullptr;
2078 friend class TestProcessingGui;
2094 QComboBox *mLayerTypeComboBox =
nullptr;
2107 QString parameterType()
const override;
2122 QVariant widgetValue() const override;
2124 QStringList compatibleParameterTypes() const override;
2126 QStringList compatibleOutputTypes() const override;
2127 QString modelerExpressionFormatString() const override;
2131 QgsProcessingMultipleLayerPanelWidget *mPanel =
nullptr;
2133 friend class TestProcessingGui;
2152 QVariant widgetValue() const override;
2153 QVariantMap customProperties() const override;
2155 QStringList compatibleParameterTypes() const override;
2157 QStringList compatibleOutputTypes() const override;
2161 QgsProcessingLayerOutputDestinationWidget *mOutputWidget =
nullptr;
2162 int mBlockSignals = 0;
2164 friend class TestProcessingGui;
2168 class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2178 QString parameterType()
const override;
2182 QString modelerExpressionFormatString()
const override;
2189 class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2199 QString parameterType()
const override;
2203 QString modelerExpressionFormatString()
const override;
2207 class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2217 QString parameterType()
const override;
2221 QString modelerExpressionFormatString()
const override;
2225 class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2235 QString parameterType()
const override;
2239 QString modelerExpressionFormatString()
const override;
2243 class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2253 QString parameterType()
const override;
2257 QString modelerExpressionFormatString()
const override;
2261 class GUI_EXPORT QgsProcessingPointCloudLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
2271 QString parameterType()
const override;
2280 QStringList compatibleParameterTypes()
const override;
2282 QStringList compatibleOutputTypes()
const override;
2284 QString modelerExpressionFormatString()
const override;
2299 QString parameterType()
const override;
2312 QVariant widgetValue() const override;
2314 QStringList compatibleParameterTypes() const override;
2316 QStringList compatibleOutputTypes() const override;
2318 QString modelerExpressionFormatString() const override;
2323 int mBlockSignals = 0;
2325 friend class TestProcessingGui;
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.
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