19 #ifndef QGSPROCESSINGWIDGETWRAPPERIMPL_H
20 #define QGSPROCESSINGWIDGETWRAPPERIMPL_H
27 #include "processing/models/qgsprocessingmodelchildparametersource.h"
29 #include <QAbstractButton>
41 class QgsProcessingMatrixParameterPanel;
62 class QgsProcessingEnumModelerWidget;
63 class QgsProcessingMatrixModelerWidget;
64 class QgsProcessingMapLayerComboBox;
66 class QgsProcessingLayerOutputDestinationWidget;
84 QCheckBox *mDefaultCheckBox =
nullptr;
113 QVariant widgetValue() const override;
115 QStringList compatibleParameterTypes() const override;
117 QStringList compatibleOutputTypes() const override;
121 QCheckBox *mCheckBox =
nullptr;
122 QComboBox *mComboBox =
nullptr;
124 friend class TestProcessingGui;
138 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
169 QVariant widgetValue() const override;
171 QStringList compatibleParameterTypes() const override;
172 QStringList compatibleOutputTypes() const override;
173 QString modelerExpressionFormatString() const override;
178 QCheckBox *mUseProjectCrsCheckBox =
nullptr;
180 friend class TestProcessingGui;
194 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
198 QLineEdit *mDefaultLineEdit =
nullptr;
199 QCheckBox *mMultiLineCheckBox =
nullptr;
227 QVariant widgetValue() const override;
229 QStringList compatibleParameterTypes() const override;
231 QStringList compatibleOutputTypes() const override;
234 QLineEdit *mLineEdit =
nullptr;
235 QPlainTextEdit *mPlainTextEdit =
nullptr;
237 friend class TestProcessingGui;
260 QVariant widgetValue() const override;
262 QStringList compatibleParameterTypes() const override;
264 QStringList compatibleOutputTypes() const override;
267 QgsAuthConfigSelect *mAuthConfigSelect =
nullptr;
269 friend class TestProcessingGui;
282 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
286 QComboBox *mTypeComboBox =
nullptr;
287 QLineEdit *mMinLineEdit =
nullptr;
288 QLineEdit *mMaxLineEdit =
nullptr;
289 QLineEdit *mDefaultLineEdit =
nullptr;
318 QVariant widgetValue() const override;
320 QStringList compatibleParameterTypes() const override;
322 QStringList compatibleOutputTypes() const override;
331 static
double calculateStep(
double minimum,
double maximum );
333 bool mAllowingNull = false;
335 friend class TestProcessingGui;
348 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
352 QComboBox *mParentLayerComboBox =
nullptr;
353 QLineEdit *mMinLineEdit =
nullptr;
354 QLineEdit *mMaxLineEdit =
nullptr;
355 QLineEdit *mDefaultLineEdit =
nullptr;
359 class GUI_EXPORT QgsProcessingDistanceWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
369 QString parameterType()
const override;
382 void setUnitParameterValue( const QVariant &value );
387 QVariant widgetValue() const override;
392 QLabel *mLabel =
nullptr;
393 QWidget *mWarningLabel =
nullptr;
394 QComboBox *mUnitsCombo =
nullptr;
396 friend class TestProcessingGui;
409 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
413 QLineEdit *mDefaultLineEdit =
nullptr;
417 class GUI_EXPORT QgsProcessingScaleWidgetWrapper :
public QgsProcessingNumericWidgetWrapper
427 QString parameterType()
const override;
440 QVariant widgetValue() const override;
447 friend class TestProcessingGui;
460 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
464 QComboBox *mTypeComboBox =
nullptr;
465 QLineEdit *mMinLineEdit =
nullptr;
466 QLineEdit *mMaxLineEdit =
nullptr;
494 QVariant widgetValue() const override;
495 QStringList compatibleParameterTypes() const override;
496 QStringList compatibleOutputTypes() const override;
497 QString modelerExpressionFormatString() const override;
506 int mBlockChangedSignal = 0;
507 bool mAllowingNull = false;
509 friend class TestProcessingGui;
521 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
525 QgsProcessingMatrixModelerWidget *mMatrixWidget =
nullptr;
553 QVariant widgetValue() const override;
555 QStringList compatibleParameterTypes() const override;
556 QStringList compatibleOutputTypes() const override;
557 QString modelerExpressionFormatString() const override;
561 QgsProcessingMatrixParameterPanel *mMatrixWidget =
nullptr;
563 friend class TestProcessingGui;
575 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
579 QComboBox *mTypeComboBox =
nullptr;
580 QComboBox *mFilterComboBox =
nullptr;
609 QVariant widgetValue() const override;
611 QStringList compatibleParameterTypes() const override;
613 QStringList compatibleOutputTypes() const override;
614 QString modelerExpressionFormatString() const override;
620 friend class TestProcessingGui;
634 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
638 QComboBox *mParentLayerComboBox =
nullptr;
669 QVariant widgetValue() const override;
671 QStringList compatibleParameterTypes() const override;
673 QStringList compatibleOutputTypes() const override;
675 QString modelerExpressionFormatString() const override;
683 friend class TestProcessingGui;
687 class GUI_EXPORT QgsProcessingEnumCheckboxPanelWidget : public QWidget
693 QgsProcessingEnumCheckboxPanelWidget( QWidget *parent =
nullptr,
const QgsProcessingParameterEnum *param =
nullptr,
int columns = 2 );
694 QVariant value()
const;
695 void setValue(
const QVariant &value );
703 void showPopupMenu();
710 QMap< QVariant, QAbstractButton * > mButtons;
711 QButtonGroup *mButtonGroup =
nullptr;
713 bool mBlockChangedSignal =
false;
715 friend class TestProcessingGui;
718 class GUI_EXPORT QgsProcessingEnumPanelWidget :
public QWidget
725 QVariant value()
const {
return mValue; }
726 void setValue(
const QVariant &value );
738 void updateSummaryText();
741 QLineEdit *mLineEdit =
nullptr;
742 QToolButton *mToolButton =
nullptr;
746 friend class TestProcessingGui;
762 QgsProcessingEnumModelerWidget *mEnumWidget =
nullptr;
790 QVariant widgetValue() const override;
792 QStringList compatibleParameterTypes() const override;
794 QStringList compatibleOutputTypes() const override;
796 QString modelerExpressionFormatString() const override;
799 QComboBox *mComboBox =
nullptr;
800 QgsProcessingEnumPanelWidget *mPanel =
nullptr;
801 QgsProcessingEnumCheckboxPanelWidget *mCheckboxPanel =
nullptr;
803 friend class TestProcessingGui;
827 QVariant widgetValue() const override;
829 QStringList compatibleParameterTypes() const override;
831 QStringList compatibleOutputTypes() const override;
833 QString modelerExpressionFormatString() const override;
837 QLineEdit *mLineEdit =
nullptr;
839 friend class TestProcessingGui;
853 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
857 QComboBox *mParentLayoutComboBox =
nullptr;
885 void setLayoutParameterValue( const QVariant &value );
891 QVariant widgetValue() const override;
893 QStringList compatibleParameterTypes() const override;
895 QStringList compatibleOutputTypes() const override;
896 QString modelerExpressionFormatString() const override;
900 QLineEdit *mLineEdit =
nullptr;
902 friend class TestProcessingGui;
905 class GUI_EXPORT QgsProcessingPointMapTool : public
QgsMapTool
910 ~QgsProcessingPointMapTool()
override;
911 void deactivate()
override;
914 void keyPressEvent( QKeyEvent *e )
override;
923 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
924 friend class TestProcessingGui;
927 class GUI_EXPORT QgsProcessingPointPanel :
public QWidget
933 QgsProcessingPointPanel( QWidget *parent );
935 void setAllowNull(
bool allowNull );
937 QVariant value()
const;
943 void toggleDialogVisibility(
bool visible );
948 void selectOnCanvas();
955 QToolButton *mButton =
nullptr;
958 QPointer< QgsMapTool > mPrevTool;
959 std::unique_ptr< QgsProcessingPointMapTool > mTool;
960 friend class TestProcessingGui;
977 QLineEdit *mDefaultLineEdit =
nullptr;
1002 void setDialog( QDialog *dialog ) override;
1007 QVariant widgetValue() const override;
1009 QStringList compatibleParameterTypes() const override;
1011 QStringList compatibleOutputTypes() const override;
1012 QString modelerExpressionFormatString() const override;
1015 QgsProcessingPointPanel *mPanel =
nullptr;
1016 QLineEdit *mLineEdit =
nullptr;
1017 QDialog *mDialog =
nullptr;
1019 friend class TestProcessingGui;
1034 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1063 void setDialog( QDialog *dialog ) override;
1068 QVariant widgetValue() const override;
1070 QStringList compatibleParameterTypes() const override;
1072 QStringList compatibleOutputTypes() const override;
1073 QString modelerExpressionFormatString() const override;
1077 QDialog *mDialog =
nullptr;
1079 friend class TestProcessingGui;
1091 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1096 QCheckBox *mAllowOpacity =
nullptr;
1124 QVariant widgetValue() const override;
1126 QStringList compatibleParameterTypes() const override;
1128 QStringList compatibleOutputTypes() const override;
1129 QString modelerExpressionFormatString() const override;
1133 friend class TestProcessingGui;
1147 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1151 QLineEdit *mDefaultLineEdit =
nullptr;
1153 QComboBox *mSourceParamComboBox =
nullptr;
1154 QComboBox *mDestParamComboBox =
nullptr;
1187 QVariant widgetValue() const override;
1189 QStringList compatibleParameterTypes() const override;
1191 QStringList compatibleOutputTypes() const override;
1192 QString modelerExpressionFormatString() const override;
1195 void setSourceCrsParameterValue( const QVariant &value );
1196 void setDestinationCrsParameterValue( const QVariant &value );
1200 QLineEdit *mLineEdit =
nullptr;
1203 friend class TestProcessingGui;
1206 class GUI_EXPORT QgsProcessingFieldPanelWidget : public QWidget
1214 void setFields(
const QgsFields &fields );
1216 QgsFields fields()
const {
return mFields; }
1218 QVariant value()
const {
return mValue; }
1219 void setValue(
const QVariant &value );
1231 void updateSummaryText();
1236 QLineEdit *mLineEdit =
nullptr;
1237 QToolButton *mToolButton =
nullptr;
1239 QVariantList mValue;
1241 friend class TestProcessingGui;
1257 QComboBox *mParentLayerComboBox =
nullptr;
1258 QComboBox *mDataTypeComboBox =
nullptr;
1259 QLineEdit *mDefaultLineEdit =
nullptr;
1260 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1261 QCheckBox *mDefaultToAllCheckBox =
nullptr;
1292 QVariant widgetValue() const override;
1294 QStringList compatibleParameterTypes() const override;
1296 QStringList compatibleOutputTypes() const override;
1297 QString modelerExpressionFormatString() const override;
1303 QgsProcessingFieldPanelWidget *mPanel =
nullptr;
1304 QLineEdit *mLineEdit =
nullptr;
1310 friend class TestProcessingGui;
1323 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1327 QComboBox *mDefaultComboBox =
nullptr;
1355 QVariant widgetValue() const override;
1357 QStringList compatibleParameterTypes() const override;
1359 QStringList compatibleOutputTypes() const override;
1360 QString modelerExpressionFormatString() const override;
1364 QComboBox *mComboBox =
nullptr;
1366 friend class TestProcessingGui;
1379 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1383 QComboBox *mTypeComboBox =
nullptr;
1411 QVariant widgetValue() const override;
1413 QStringList compatibleParameterTypes() const override;
1415 QStringList compatibleOutputTypes() const override;
1416 QString modelerExpressionFormatString() const override;
1424 friend class TestProcessingGui;
1442 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1446 QComboBox *mProviderComboBox =
nullptr;
1447 QLineEdit *mDefaultEdit =
nullptr;
1476 QVariant widgetValue() const override;
1478 QStringList compatibleParameterTypes() const override;
1480 QStringList compatibleOutputTypes() const override;
1481 QString modelerExpressionFormatString() const override;
1486 int mBlockSignals = 0;
1488 friend class TestProcessingGui;
1502 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1506 QComboBox *mConnectionParamComboBox =
nullptr;
1507 QLineEdit *mDefaultEdit =
nullptr;
1523 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1540 QVariant widgetValue() const override;
1542 QStringList compatibleParameterTypes() const override;
1544 QStringList compatibleOutputTypes() const override;
1545 QString modelerExpressionFormatString() const override;
1550 int mBlockSignals = 0;
1552 friend class TestProcessingGui;
1567 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1571 QComboBox *mConnectionParamComboBox =
nullptr;
1572 QComboBox *mSchemaParamComboBox =
nullptr;
1573 QLineEdit *mDefaultEdit =
nullptr;
1589 void postInitialize(
const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers )
override;
1607 QVariant widgetValue() const override;
1609 QStringList compatibleParameterTypes() const override;
1611 QStringList compatibleOutputTypes() const override;
1612 QString modelerExpressionFormatString() const override;
1617 int mBlockSignals = 0;
1618 QString mConnection;
1622 friend class TestProcessingGui;
1634 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1665 QVariant widgetValue() const override;
1667 QStringList compatibleParameterTypes() const override;
1669 QStringList compatibleOutputTypes() const override;
1670 QString modelerExpressionFormatString() const override;
1674 QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1675 int mBlockSignals = 0;
1677 friend class TestProcessingGui;
1681 class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1725 class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1735 QString parameterType()
const override;
1744 QStringList compatibleParameterTypes()
const override;
1746 QStringList compatibleOutputTypes()
const override;
1748 QString modelerExpressionFormatString()
const override;
1769 class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1779 QString parameterType()
const override;
1788 QStringList compatibleParameterTypes()
const override;
1790 QStringList compatibleOutputTypes()
const override;
1792 QString modelerExpressionFormatString()
const override;
1797 class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper :
public QgsProcessingMapLayerWidgetWrapper
1807 QString parameterType()
const override;
1816 QStringList compatibleParameterTypes()
const override;
1818 QStringList compatibleOutputTypes()
const override;
1820 QString modelerExpressionFormatString()
const override;
1825 class GUI_EXPORT QgsProcessingRasterBandPanelWidget :
public QWidget
1833 void setBands(
const QList< int > &bands );
1834 void setBandNames(
const QHash<int, QString > &names );
1835 QList< int > bands()
const {
return mBands; }
1837 QVariant value()
const {
return mValue; }
1838 void setValue(
const QVariant &value );
1850 void updateSummaryText();
1852 QList< int > mBands;
1853 QHash<int, QString > mBandNames;
1856 QLineEdit *mLineEdit =
nullptr;
1857 QToolButton *mToolButton =
nullptr;
1859 QVariantList mValue;
1861 friend class TestProcessingGui;
1877 QComboBox *mParentLayerComboBox =
nullptr;
1878 QLineEdit *mDefaultLineEdit =
nullptr;
1879 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1910 QVariant widgetValue() const override;
1912 QStringList compatibleParameterTypes() const override;
1914 QStringList compatibleOutputTypes() const override;
1915 QString modelerExpressionFormatString() const override;
1920 QgsProcessingRasterBandPanelWidget *mPanel =
nullptr;
1921 QLineEdit *mLineEdit =
nullptr;
1925 friend class TestProcessingGui;
1930 class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
1938 QVariant value()
const {
return mValue; }
1939 void setValue(
const QVariant &value );
1942 void setModel( QgsProcessingModelAlgorithm *model,
const QString &modelChildAlgorithmID );
1954 void updateSummaryText();
1957 QLineEdit *mLineEdit =
nullptr;
1958 QToolButton *mToolButton =
nullptr;
1960 QVariantList mValue;
1961 QList< QgsProcessingModelChildParameterSource > mModelSources;
1962 QgsProcessingModelAlgorithm *mModel =
nullptr;
1966 friend class TestProcessingGui;
1982 QComboBox *mLayerTypeComboBox =
nullptr;
2010 QVariant widgetValue() const override;
2012 QStringList compatibleParameterTypes() const override;
2014 QStringList compatibleOutputTypes() const override;
2015 QString modelerExpressionFormatString() const override;
2019 QgsProcessingMultipleLayerPanelWidget *mPanel =
nullptr;
2021 friend class TestProcessingGui;
2040 QVariant widgetValue() const override;
2041 QVariantMap customProperties() const override;
2043 QStringList compatibleParameterTypes() const override;
2045 QStringList compatibleOutputTypes() const override;
2049 QgsProcessingLayerOutputDestinationWidget *mOutputWidget =
nullptr;
2050 int mBlockSignals = 0;
2052 friend class TestProcessingGui;
2056 class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2077 class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2087 QString parameterType()
const override;
2091 QString modelerExpressionFormatString()
const override;
2095 class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2105 QString parameterType()
const override;
2109 QString modelerExpressionFormatString()
const override;
2113 class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2123 QString parameterType()
const override;
2127 QString modelerExpressionFormatString()
const override;
2131 class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper :
public QgsProcessingOutputWidgetWrapper
2141 QString parameterType()
const override;
2145 QString modelerExpressionFormatString()
const override;
2151 #endif // QGSPROCESSINGWIDGETWRAPPERIMPL_H