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;
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;
139 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
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;
195 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
199 QLineEdit *mDefaultLineEdit =
nullptr;
200 QCheckBox *mMultiLineCheckBox =
nullptr;
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;
261 QVariant widgetValue() const override;
263 QStringList compatibleParameterTypes() const override;
265 QStringList compatibleOutputTypes() const override;
268 QgsAuthConfigSelect *mAuthConfigSelect =
nullptr;
270 friend class TestProcessingGui;
283 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
287 QComboBox *mTypeComboBox =
nullptr;
288 QLineEdit *mMinLineEdit =
nullptr;
289 QLineEdit *mMaxLineEdit =
nullptr;
290 QLineEdit *mDefaultLineEdit =
nullptr;
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;
349 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
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;
410 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
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;
461 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
465 QComboBox *mTypeComboBox =
nullptr;
466 QLineEdit *mMinLineEdit =
nullptr;
467 QLineEdit *mMaxLineEdit =
nullptr;
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;
522 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
526 QgsProcessingMatrixModelerWidget *mMatrixWidget =
nullptr;
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;
576 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
580 QComboBox *mTypeComboBox =
nullptr;
581 QComboBox *mFilterComboBox =
nullptr;
610 QVariant widgetValue() const override;
612 QStringList compatibleParameterTypes() const override;
614 QStringList compatibleOutputTypes() const override;
615 QString modelerExpressionFormatString() const override;
621 friend class TestProcessingGui;
635 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
639 QComboBox *mParentLayerComboBox =
nullptr;
670 QVariant widgetValue() const override;
672 QStringList compatibleParameterTypes() const override;
674 QStringList compatibleOutputTypes() const override;
676 QString modelerExpressionFormatString() const override;
685 friend class TestProcessingGui;
689 class GUI_EXPORT QgsProcessingEnumCheckboxPanelWidget : public QWidget
695 QgsProcessingEnumCheckboxPanelWidget( QWidget *parent =
nullptr,
const QgsProcessingParameterEnum *param =
nullptr,
int columns = 2 );
696 QVariant value()
const;
697 void setValue(
const QVariant &value );
705 void showPopupMenu();
712 QMap< QVariant, QAbstractButton * > mButtons;
713 QButtonGroup *mButtonGroup =
nullptr;
715 bool mBlockChangedSignal =
false;
717 friend class TestProcessingGui;
720 class GUI_EXPORT QgsProcessingEnumPanelWidget :
public QWidget
727 QVariant value()
const {
return mValue; }
728 void setValue(
const QVariant &value );
740 void updateSummaryText();
743 QLineEdit *mLineEdit =
nullptr;
744 QToolButton *mToolButton =
nullptr;
748 friend class TestProcessingGui;
764 QgsProcessingEnumModelerWidget *mEnumWidget =
nullptr;
792 QVariant widgetValue() const override;
794 QStringList compatibleParameterTypes() const override;
796 QStringList compatibleOutputTypes() const override;
798 QString modelerExpressionFormatString() const override;
801 QComboBox *mComboBox =
nullptr;
802 QgsProcessingEnumPanelWidget *mPanel =
nullptr;
803 QgsProcessingEnumCheckboxPanelWidget *mCheckboxPanel =
nullptr;
805 friend class TestProcessingGui;
829 QVariant widgetValue() const override;
832 QStringList compatibleParameterTypes() const override;
834 QStringList compatibleOutputTypes() const override;
836 QString modelerExpressionFormatString() const override;
840 QComboBox *mPlainComboBox =
nullptr;
842 friend class TestProcessingGui;
856 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
860 QComboBox *mParentLayoutComboBox =
nullptr;
888 void setLayoutParameterValue( const QVariant &value );
894 QVariant widgetValue() const override;
896 QStringList compatibleParameterTypes() const override;
898 QStringList compatibleOutputTypes() const override;
899 QString modelerExpressionFormatString() const override;
903 QLineEdit *mLineEdit =
nullptr;
905 friend class TestProcessingGui;
908 class GUI_EXPORT QgsProcessingPointMapTool : public
QgsMapTool
913 ~QgsProcessingPointMapTool()
override;
914 void deactivate()
override;
917 void keyPressEvent( QKeyEvent *e )
override;
926 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
927 friend class TestProcessingGui;
930 class GUI_EXPORT QgsProcessingPointPanel :
public QWidget
936 QgsProcessingPointPanel( QWidget *parent );
938 void setAllowNull(
bool allowNull );
940 QVariant value()
const;
946 void toggleDialogVisibility(
bool visible );
951 void selectOnCanvas();
958 QToolButton *mButton =
nullptr;
961 QPointer< QgsMapTool > mPrevTool;
962 std::unique_ptr< QgsProcessingPointMapTool > mTool;
963 friend class TestProcessingGui;
980 QLineEdit *mDefaultLineEdit =
nullptr;
1005 void setDialog( QDialog *dialog ) override;
1010 QVariant widgetValue() const override;
1012 QStringList compatibleParameterTypes() const override;
1014 QStringList compatibleOutputTypes() const override;
1015 QString modelerExpressionFormatString() const override;
1018 QgsProcessingPointPanel *mPanel =
nullptr;
1019 QLineEdit *mLineEdit =
nullptr;
1020 QDialog *mDialog =
nullptr;
1022 friend class TestProcessingGui;
1034 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1038 QLineEdit *mDefaultLineEdit =
nullptr;
1066 QVariant widgetValue() const override;
1068 QStringList compatibleParameterTypes() const override;
1070 QStringList compatibleOutputTypes() const override;
1071 QString modelerExpressionFormatString() const override;
1074 QLineEdit *mLineEdit =
nullptr;
1076 friend class TestProcessingGui;
1088 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1117 void setDialog( QDialog *dialog ) override;
1122 QVariant widgetValue() const override;
1124 QStringList compatibleParameterTypes() const override;
1126 QStringList compatibleOutputTypes() const override;
1127 QString modelerExpressionFormatString() const override;
1131 QDialog *mDialog =
nullptr;
1133 friend class TestProcessingGui;
1145 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1150 QCheckBox *mAllowOpacity =
nullptr;
1178 QVariant widgetValue() const override;
1180 QStringList compatibleParameterTypes() const override;
1182 QStringList compatibleOutputTypes() const override;
1183 QString modelerExpressionFormatString() const override;
1187 friend class TestProcessingGui;
1201 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1205 QLineEdit *mDefaultLineEdit =
nullptr;
1207 QComboBox *mSourceParamComboBox =
nullptr;
1208 QComboBox *mDestParamComboBox =
nullptr;
1241 QVariant widgetValue() const override;
1243 QStringList compatibleParameterTypes() const override;
1245 QStringList compatibleOutputTypes() const override;
1246 QString modelerExpressionFormatString() const override;
1249 void setSourceCrsParameterValue( const QVariant &value );
1250 void setDestinationCrsParameterValue( const QVariant &value );
1254 QLineEdit *mLineEdit =
nullptr;
1257 friend class TestProcessingGui;
1260 class GUI_EXPORT QgsProcessingFieldPanelWidget : public QWidget
1268 void setFields(
const QgsFields &fields );
1270 QgsFields fields()
const {
return mFields; }
1272 QVariant value()
const {
return mValue; }
1273 void setValue(
const QVariant &value );
1285 void updateSummaryText();
1290 QLineEdit *mLineEdit =
nullptr;
1291 QToolButton *mToolButton =
nullptr;
1293 QVariantList mValue;
1295 friend class TestProcessingGui;
1311 QComboBox *mParentLayerComboBox =
nullptr;
1312 QComboBox *mDataTypeComboBox =
nullptr;
1313 QLineEdit *mDefaultLineEdit =
nullptr;
1314 QCheckBox *mAllowMultipleCheckBox =
nullptr;
1315 QCheckBox *mDefaultToAllCheckBox =
nullptr;
1346 QVariant widgetValue() const override;
1348 QStringList compatibleParameterTypes() const override;
1350 QStringList compatibleOutputTypes() const override;
1351 QString modelerExpressionFormatString() const override;
1357 QgsProcessingFieldPanelWidget *mPanel =
nullptr;
1358 QLineEdit *mLineEdit =
nullptr;
1364 friend class TestProcessingGui;
1377 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1381 QComboBox *mDefaultComboBox =
nullptr;
1409 QVariant widgetValue() const override;
1411 QStringList compatibleParameterTypes() const override;
1413 QStringList compatibleOutputTypes() const override;
1414 QString modelerExpressionFormatString() const override;
1418 QComboBox *mComboBox =
nullptr;
1420 friend class TestProcessingGui;
1433 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1437 QComboBox *mTypeComboBox =
nullptr;
1465 QVariant widgetValue() const override;
1467 QStringList compatibleParameterTypes() const override;
1469 QStringList compatibleOutputTypes() const override;
1470 QString modelerExpressionFormatString() const override;
1478 friend class TestProcessingGui;
1496 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1500 QComboBox *mProviderComboBox =
nullptr;
1501 QLineEdit *mDefaultEdit =
nullptr;
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;
1556 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1560 QComboBox *mConnectionParamComboBox =
nullptr;
1561 QLineEdit *mDefaultEdit =
nullptr;
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;
1621 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
const override;
1625 QComboBox *mConnectionParamComboBox =
nullptr;
1626 QComboBox *mSchemaParamComboBox =
nullptr;
1627 QLineEdit *mDefaultEdit =
nullptr;
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;
1688 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description, QgsProcessingParameterDefinition::Flags flags )
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
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;
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;
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
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;
2205 #endif // QGSPROCESSINGWIDGETWRAPPERIMPL_H