QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsprocessingwidgetwrapperimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingwidgetwrapperimpl.h
3  ---------------------
4  begin : August 2018
5  copyright : (C) 2018 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 
19 #ifndef QGSPROCESSINGWIDGETWRAPPERIMPL_H
20 #define QGSPROCESSINGWIDGETWRAPPERIMPL_H
21 
22 #define SIP_NO_FILE
25 #include "qgsmaptool.h"
26 #include "qgsprocessingcontext.h"
28 
29 #include <QAbstractButton>
30 
31 class QCheckBox;
32 class QComboBox;
33 class QLineEdit;
34 class QPlainTextEdit;
35 class QToolButton;
36 class QButtonGroup;
38 class QgsSpinBox;
39 class QgsDoubleSpinBox;
41 class QgsProcessingMatrixParameterPanel;
42 class QgsFileWidget;
47 class QgsLayoutComboBox;
49 class QgsPrintLayout;
50 class QgsScaleWidget;
51 class QgsSnapIndicator;
52 class QgsFilterLineEdit;
53 class QgsColorButton;
55 class QgsFieldComboBox;
56 class QgsDateTimeEdit;
57 class QgsDateEdit;
58 class QgsTimeEdit;
62 class QgsExtentWidget;
63 class QgsProcessingEnumModelerWidget;
64 class QgsProcessingMatrixModelerWidget;
65 class QgsProcessingMapLayerComboBox;
67 class QgsProcessingLayerOutputDestinationWidget;
70 
72 
73 class GUI_EXPORT QgsProcessingBooleanParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
74 {
75  Q_OBJECT
76  public:
77 
78  QgsProcessingBooleanParameterDefinitionWidget( QgsProcessingContext &context,
79  const QgsProcessingParameterWidgetContext &widgetContext,
80  const QgsProcessingParameterDefinition *definition = nullptr,
81  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
82  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
83 
84  private:
85 
86  QCheckBox *mDefaultCheckBox = nullptr;
87 
88 };
89 
90 class GUI_EXPORT QgsProcessingBooleanWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
91 {
92  Q_OBJECT
93 
94  public:
95 
96  QgsProcessingBooleanWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
97  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
98 
99  // QgsProcessingParameterWidgetFactoryInterface
100  QString parameterType() const override;
103  QgsProcessingContext &context,
104  const QgsProcessingParameterWidgetContext &widgetContext,
105  const QgsProcessingParameterDefinition *definition = nullptr,
106  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
107 
108  // QgsProcessingParameterWidgetWrapper interface
109  QWidget *createWidget() override SIP_FACTORY;
110  QLabel *createLabel() override SIP_FACTORY;
111 
112  protected:
113 
114  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
115  QVariant widgetValue() const override;
116 
117  QStringList compatibleParameterTypes() const override;
118 
119  QStringList compatibleOutputTypes() const override;
120 
121  private:
122 
123  QCheckBox *mCheckBox = nullptr;
124  QComboBox *mComboBox = nullptr;
125 
126  friend class TestProcessingGui;
127 };
128 
129 
130 
131 class GUI_EXPORT QgsProcessingCrsParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
132 {
133  Q_OBJECT
134  public:
135 
136  QgsProcessingCrsParameterDefinitionWidget( QgsProcessingContext &context,
137  const QgsProcessingParameterWidgetContext &widgetContext,
138  const QgsProcessingParameterDefinition *definition = nullptr,
139  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
140  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
141 
142  private:
143 
144  QgsProjectionSelectionWidget *mCrsSelector = nullptr;
145 };
146 
147 class GUI_EXPORT QgsProcessingCrsWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
148 {
149  Q_OBJECT
150 
151  public:
152 
153  QgsProcessingCrsWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
154  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
155 
156  // QgsProcessingParameterWidgetFactoryInterface
157  QString parameterType() const override;
160  QgsProcessingContext &context,
161  const QgsProcessingParameterWidgetContext &widgetContext,
162  const QgsProcessingParameterDefinition *definition = nullptr,
163  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
164 
165  // QgsProcessingParameterWidgetWrapper interface
166  QWidget *createWidget() override SIP_FACTORY;
167 
168  protected:
169 
170  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
171  QVariant widgetValue() const override;
172 
173  QStringList compatibleParameterTypes() const override;
174  QStringList compatibleOutputTypes() const override;
175  QString modelerExpressionFormatString() const override;
176 
177  private:
178 
179  QgsProjectionSelectionWidget *mProjectionSelectionWidget = nullptr;
180  QCheckBox *mUseProjectCrsCheckBox = nullptr;
181 
182  friend class TestProcessingGui;
183 };
184 
185 
186 
187 class GUI_EXPORT QgsProcessingStringParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
188 {
189  Q_OBJECT
190  public:
191 
192  QgsProcessingStringParameterDefinitionWidget( QgsProcessingContext &context,
193  const QgsProcessingParameterWidgetContext &widgetContext,
194  const QgsProcessingParameterDefinition *definition = nullptr,
195  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
196  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
197 
198  private:
199 
200  QLineEdit *mDefaultLineEdit = nullptr;
201  QCheckBox *mMultiLineCheckBox = nullptr;
202 
203 };
204 
205 class GUI_EXPORT QgsProcessingStringWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
206 {
207  Q_OBJECT
208 
209  public:
210 
211  QgsProcessingStringWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
212  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
213 
214  // QgsProcessingParameterWidgetFactoryInterface
215  QString parameterType() const override;
218  QgsProcessingContext &context,
219  const QgsProcessingParameterWidgetContext &widgetContext,
220  const QgsProcessingParameterDefinition *definition = nullptr,
221  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
222 
223  // QgsProcessingParameterWidgetWrapper interface
224  QWidget *createWidget() override SIP_FACTORY;
225 
226  protected:
227 
228  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
229  QVariant widgetValue() const override;
230 
231  QStringList compatibleParameterTypes() const override;
232 
233  QStringList compatibleOutputTypes() const override;
234  private:
235 
236  QLineEdit *mLineEdit = nullptr;
237  QComboBox *mComboBox = nullptr;
238  QPlainTextEdit *mPlainTextEdit = nullptr;
239 
240  friend class TestProcessingGui;
241 };
242 
243 
244 class GUI_EXPORT QgsProcessingAuthConfigWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
245 {
246  Q_OBJECT
247 
248  public:
249 
250  QgsProcessingAuthConfigWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
251  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
252 
253  // QgsProcessingParameterWidgetFactoryInterface
254  QString parameterType() const override;
256 
257  // QgsProcessingParameterWidgetWrapper interface
258  QWidget *createWidget() override SIP_FACTORY;
259 
260  protected:
261 
262  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
263  QVariant widgetValue() const override;
264 
265  QStringList compatibleParameterTypes() const override;
266 
267  QStringList compatibleOutputTypes() const override;
268  private:
269 
270  QgsAuthConfigSelect *mAuthConfigSelect = nullptr;
271 
272  friend class TestProcessingGui;
273 };
274 
275 
276 class GUI_EXPORT QgsProcessingNumberParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
277 {
278  Q_OBJECT
279  public:
280 
281  QgsProcessingNumberParameterDefinitionWidget( QgsProcessingContext &context,
282  const QgsProcessingParameterWidgetContext &widgetContext,
283  const QgsProcessingParameterDefinition *definition = nullptr,
284  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
285  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
286 
287  private:
288 
289  QComboBox *mTypeComboBox = nullptr;
290  QLineEdit *mMinLineEdit = nullptr;
291  QLineEdit *mMaxLineEdit = nullptr;
292  QLineEdit *mDefaultLineEdit = nullptr;
293 
294 };
295 
296 
297 class GUI_EXPORT QgsProcessingNumericWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
298 {
299  Q_OBJECT
300 
301  public:
302 
303  QgsProcessingNumericWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
304  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
305 
306  // QgsProcessingParameterWidgetFactoryInterface
307  QString parameterType() const override;
310  QgsProcessingContext &context,
311  const QgsProcessingParameterWidgetContext &widgetContext,
312  const QgsProcessingParameterDefinition *definition = nullptr,
313  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
314 
315  // QgsProcessingParameterWidgetWrapper interface
316  QWidget *createWidget() override SIP_FACTORY;
317 
318  protected:
319 
320  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
321  QVariant widgetValue() const override;
322 
323  QStringList compatibleParameterTypes() const override;
324 
325  QStringList compatibleOutputTypes() const override;
326 
327  protected:
328 
329  QgsSpinBox *mSpinBox = nullptr;
330  QgsDoubleSpinBox *mDoubleSpinBox = nullptr;
331 
332  private:
333 
334  static double calculateStep( double minimum, double maximum );
335 
336  bool mAllowingNull = false;
337 
338  friend class TestProcessingGui;
339 };
340 
341 
342 class GUI_EXPORT QgsProcessingDistanceParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
343 {
344  Q_OBJECT
345  public:
346 
347  QgsProcessingDistanceParameterDefinitionWidget( QgsProcessingContext &context,
348  const QgsProcessingParameterWidgetContext &widgetContext,
349  const QgsProcessingParameterDefinition *definition = nullptr,
350  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
351  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
352 
353  private:
354 
355  QComboBox *mParentLayerComboBox = nullptr;
356  QLineEdit *mMinLineEdit = nullptr;
357  QLineEdit *mMaxLineEdit = nullptr;
358  QLineEdit *mDefaultLineEdit = nullptr;
359 
360 };
361 
362 class GUI_EXPORT QgsProcessingDistanceWidgetWrapper : public QgsProcessingNumericWidgetWrapper
363 {
364  Q_OBJECT
365 
366  public:
367 
368  QgsProcessingDistanceWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
369  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
370 
371  // QgsProcessingParameterWidgetFactoryInterface
372  QString parameterType() const override;
374  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
375  QgsProcessingContext &context,
376  const QgsProcessingParameterWidgetContext &widgetContext,
377  const QgsProcessingParameterDefinition *definition = nullptr,
378  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
379 
380  // QgsProcessingParameterWidgetWrapper interface
381  QWidget *createWidget() override SIP_FACTORY;
382  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
383 
384  public slots:
385  void setUnitParameterValue( const QVariant &value );
386  void setUnits( QgsUnitTypes::DistanceUnit unit );
387 
388  protected:
389 
390  QVariant widgetValue() const override;
391 
392  private:
393 
394  QgsUnitTypes::DistanceUnit mBaseUnit = QgsUnitTypes::DistanceUnknownUnit;
395  QLabel *mLabel = nullptr;
396  QWidget *mWarningLabel = nullptr;
397  QComboBox *mUnitsCombo = nullptr;
398 
399  friend class TestProcessingGui;
400 };
401 
402 
403 class GUI_EXPORT QgsProcessingDurationParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
404 {
405  Q_OBJECT
406  public:
407 
408  QgsProcessingDurationParameterDefinitionWidget( QgsProcessingContext &context,
409  const QgsProcessingParameterWidgetContext &widgetContext,
410  const QgsProcessingParameterDefinition *definition = nullptr,
411  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
412  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
413 
414  private:
415 
416  QLineEdit *mMinLineEdit = nullptr;
417  QLineEdit *mMaxLineEdit = nullptr;
418  QLineEdit *mDefaultLineEdit = nullptr;
419  QComboBox *mUnitsCombo = nullptr;
420 
421 };
422 
423 class GUI_EXPORT QgsProcessingDurationWidgetWrapper : public QgsProcessingNumericWidgetWrapper
424 {
425  Q_OBJECT
426 
427  public:
428 
429  QgsProcessingDurationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
430  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
431 
432  // QgsProcessingParameterWidgetFactoryInterface
433  QString parameterType() const override;
435  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
436  QgsProcessingContext &context,
437  const QgsProcessingParameterWidgetContext &widgetContext,
438  const QgsProcessingParameterDefinition *definition = nullptr,
439  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
440 
441  // QgsProcessingParameterWidgetWrapper interface
442  QWidget *createWidget() override SIP_FACTORY;
443  QLabel *createLabel() override SIP_FACTORY;
444 
445  protected:
446 
447  QVariant widgetValue() const override;
448  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
449 
450  private:
451 
452  QgsUnitTypes::TemporalUnit mBaseUnit = QgsUnitTypes::TemporalMilliseconds;
453  QComboBox *mUnitsCombo = nullptr;
454 
455  friend class TestProcessingGui;
456 };
457 
458 class GUI_EXPORT QgsProcessingScaleParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
459 {
460  Q_OBJECT
461  public:
462 
463  QgsProcessingScaleParameterDefinitionWidget( QgsProcessingContext &context,
464  const QgsProcessingParameterWidgetContext &widgetContext,
465  const QgsProcessingParameterDefinition *definition = nullptr,
466  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
467  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
468 
469  private:
470 
471  QLineEdit *mDefaultLineEdit = nullptr;
472 
473 };
474 
475 class GUI_EXPORT QgsProcessingScaleWidgetWrapper : public QgsProcessingNumericWidgetWrapper
476 {
477  Q_OBJECT
478 
479  public:
480 
481  QgsProcessingScaleWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
482  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
483 
484  // QgsProcessingParameterWidgetFactoryInterface
485  QString parameterType() const override;
487  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
488  QgsProcessingContext &context,
489  const QgsProcessingParameterWidgetContext &widgetContext,
490  const QgsProcessingParameterDefinition *definition = nullptr,
491  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
492 
493  // QgsProcessingParameterWidgetWrapper interface
494  QWidget *createWidget() override SIP_FACTORY;
495  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
496  protected:
497 
498  QVariant widgetValue() const override;
499  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
500 
501  private:
502 
503  QgsScaleWidget *mScaleWidget = nullptr;
504 
505  friend class TestProcessingGui;
506 };
507 
508 
509 class GUI_EXPORT QgsProcessingRangeParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
510 {
511  Q_OBJECT
512  public:
513 
514  QgsProcessingRangeParameterDefinitionWidget( QgsProcessingContext &context,
515  const QgsProcessingParameterWidgetContext &widgetContext,
516  const QgsProcessingParameterDefinition *definition = nullptr,
517  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
518  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
519 
520  private:
521 
522  QComboBox *mTypeComboBox = nullptr;
523  QLineEdit *mMinLineEdit = nullptr;
524  QLineEdit *mMaxLineEdit = nullptr;
525 
526 };
527 
528 class GUI_EXPORT QgsProcessingRangeWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
529 {
530  Q_OBJECT
531 
532  public:
533 
534  QgsProcessingRangeWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
535  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
536 
537  // QgsProcessingParameterWidgetFactoryInterface
538  QString parameterType() const override;
541  QgsProcessingContext &context,
542  const QgsProcessingParameterWidgetContext &widgetContext,
543  const QgsProcessingParameterDefinition *definition = nullptr,
544  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
545 
546  // QgsProcessingParameterWidgetWrapper interface
547  QWidget *createWidget() override SIP_FACTORY;
548 
549  protected:
550 
551  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
552  QVariant widgetValue() const override;
553  QStringList compatibleParameterTypes() const override;
554  QStringList compatibleOutputTypes() const override;
555  QString modelerExpressionFormatString() const override;
556 
557  protected:
558 
559  QgsDoubleSpinBox *mMinSpinBox = nullptr;
560  QgsDoubleSpinBox *mMaxSpinBox = nullptr;
561 
562  private:
563 
564  int mBlockChangedSignal = 0;
565  bool mAllowingNull = false;
566 
567  friend class TestProcessingGui;
568 };
569 
570 class GUI_EXPORT QgsProcessingMatrixParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
571 {
572  Q_OBJECT
573  public:
574 
575  QgsProcessingMatrixParameterDefinitionWidget( QgsProcessingContext &context,
576  const QgsProcessingParameterWidgetContext &widgetContext,
577  const QgsProcessingParameterDefinition *definition = nullptr,
578  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
579  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
580 
581  private:
582 
583  QgsProcessingMatrixModelerWidget *mMatrixWidget = nullptr;
584 
585 };
586 
587 class GUI_EXPORT QgsProcessingMatrixWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
588 {
589  Q_OBJECT
590 
591  public:
592 
593  QgsProcessingMatrixWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
594  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
595 
596  // QgsProcessingParameterWidgetFactoryInterface
597  QString parameterType() const override;
600  QgsProcessingContext &context,
601  const QgsProcessingParameterWidgetContext &widgetContext,
602  const QgsProcessingParameterDefinition *definition = nullptr,
603  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
604 
605  // QgsProcessingParameterWidgetWrapper interface
606  QWidget *createWidget() override SIP_FACTORY;
607 
608  protected:
609 
610  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
611  QVariant widgetValue() const override;
612 
613  QStringList compatibleParameterTypes() const override;
614  QStringList compatibleOutputTypes() const override;
615  QString modelerExpressionFormatString() const override;
616 
617  private:
618 
619  QgsProcessingMatrixParameterPanel *mMatrixWidget = nullptr;
620 
621  friend class TestProcessingGui;
622 };
623 
624 class GUI_EXPORT QgsProcessingFileParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
625 {
626  Q_OBJECT
627  public:
628 
629  QgsProcessingFileParameterDefinitionWidget( QgsProcessingContext &context,
630  const QgsProcessingParameterWidgetContext &widgetContext,
631  const QgsProcessingParameterDefinition *definition = nullptr,
632  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
633  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
634 
635  private:
636 
637  QComboBox *mTypeComboBox = nullptr;
638  QComboBox *mFilterComboBox = nullptr;
639  QgsFileWidget *mDefaultFileWidget = nullptr;
640 
641 };
642 
643 class GUI_EXPORT QgsProcessingFileWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
644 {
645  Q_OBJECT
646 
647  public:
648 
649  QgsProcessingFileWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
650  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
651 
652  // QgsProcessingParameterWidgetFactoryInterface
653  QString parameterType() const override;
656  QgsProcessingContext &context,
657  const QgsProcessingParameterWidgetContext &widgetContext,
658  const QgsProcessingParameterDefinition *definition = nullptr,
659  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
660 
661  // QgsProcessingParameterWidgetWrapper interface
662  QWidget *createWidget() override SIP_FACTORY;
663 
664  protected:
665 
666  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
667  QVariant widgetValue() const override;
668 
669  QStringList compatibleParameterTypes() const override;
670 
671  QStringList compatibleOutputTypes() const override;
672  QString modelerExpressionFormatString() const override;
673 
674  private:
675 
676  QgsFileWidget *mFileWidget = nullptr;
677 
678  friend class TestProcessingGui;
679 };
680 
681 
682 
683 class GUI_EXPORT QgsProcessingExpressionParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
684 {
685  Q_OBJECT
686  public:
687 
688  QgsProcessingExpressionParameterDefinitionWidget( QgsProcessingContext &context,
689  const QgsProcessingParameterWidgetContext &widgetContext,
690  const QgsProcessingParameterDefinition *definition = nullptr,
691  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
692  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
693 
694  private:
695 
696  QComboBox *mParentLayerComboBox = nullptr;
697  QgsExpressionLineEdit *mDefaultLineEdit = nullptr;
698 
699 };
700 
701 class GUI_EXPORT QgsProcessingExpressionWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
702 {
703  Q_OBJECT
704 
705  public:
706 
707  QgsProcessingExpressionWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
708  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
709 
710  // QgsProcessingParameterWidgetFactoryInterface
711  QString parameterType() const override;
714  QgsProcessingContext &context,
715  const QgsProcessingParameterWidgetContext &widgetContext,
716  const QgsProcessingParameterDefinition *definition = nullptr,
717  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
718 
719  // QgsProcessingParameterWidgetWrapper interface
720  QWidget *createWidget() override SIP_FACTORY;
721  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
722  void registerProcessingContextGenerator( QgsProcessingContextGenerator *generator ) override;
723 
724  public slots:
725  void setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
726  protected:
727 
728  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
729  QVariant widgetValue() const override;
730 
731  QStringList compatibleParameterTypes() const override;
732 
733  QStringList compatibleOutputTypes() const override;
734 
735  QString modelerExpressionFormatString() const override;
736  const QgsVectorLayer *linkedVectorLayer() const override;
737  private:
738 
739  QgsFieldExpressionWidget *mFieldExpWidget = nullptr;
740  QgsExpressionBuilderWidget *mExpBuilderWidget = nullptr;
741  QgsExpressionLineEdit *mExpLineEdit = nullptr;
742  std::unique_ptr< QgsVectorLayer > mParentLayer;
743 
744  friend class TestProcessingGui;
745 };
746 
747 
748 class GUI_EXPORT QgsProcessingEnumCheckboxPanelWidget : public QWidget
749 {
750  Q_OBJECT
751 
752  public:
753 
754  QgsProcessingEnumCheckboxPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterEnum *param = nullptr, int columns = 2 );
755  QVariant value() const;
756  void setValue( const QVariant &value );
757 
758  signals:
759 
760  void changed();
761 
762  private slots:
763 
764  void showPopupMenu();
765  void selectAll();
766  void deselectAll();
767 
768  private:
769 
770  const QgsProcessingParameterEnum *mParam = nullptr;
771  QMap< QVariant, QAbstractButton * > mButtons;
772  QButtonGroup *mButtonGroup = nullptr;
773  int mColumns = 2;
774  bool mBlockChangedSignal = false;
775 
776  friend class TestProcessingGui;
777 };
778 
779 class GUI_EXPORT QgsProcessingEnumPanelWidget : public QWidget
780 {
781  Q_OBJECT
782 
783  public:
784 
785  QgsProcessingEnumPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterEnum *param = nullptr );
786  QVariant value() const { return mValue; }
787  void setValue( const QVariant &value );
788 
789  signals:
790 
791  void changed();
792 
793  private slots:
794 
795  void showDialog();
796 
797  private:
798 
799  void updateSummaryText();
800 
801  const QgsProcessingParameterEnum *mParam = nullptr;
802  QLineEdit *mLineEdit = nullptr;
803  QToolButton *mToolButton = nullptr;
804 
805  QVariantList mValue;
806 
807  friend class TestProcessingGui;
808 };
809 
810 class GUI_EXPORT QgsProcessingEnumParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
811 {
812  Q_OBJECT
813  public:
814 
815  QgsProcessingEnumParameterDefinitionWidget( QgsProcessingContext &context,
816  const QgsProcessingParameterWidgetContext &widgetContext,
817  const QgsProcessingParameterDefinition *definition = nullptr,
818  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
819  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
820 
821  private:
822 
823  QgsProcessingEnumModelerWidget *mEnumWidget = nullptr;
824 
825 };
826 
827 class GUI_EXPORT QgsProcessingEnumWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
828 {
829  Q_OBJECT
830 
831  public:
832 
833  QgsProcessingEnumWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
834  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
835 
836  // QgsProcessingParameterWidgetFactoryInterface
837  QString parameterType() const override;
840  QgsProcessingContext &context,
841  const QgsProcessingParameterWidgetContext &widgetContext,
842  const QgsProcessingParameterDefinition *definition = nullptr,
843  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
844 
845  // QgsProcessingParameterWidgetWrapper interface
846  QWidget *createWidget() override SIP_FACTORY;
847 
848  protected:
849 
850  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
851  QVariant widgetValue() const override;
852 
853  QStringList compatibleParameterTypes() const override;
854 
855  QStringList compatibleOutputTypes() const override;
856 
857  QString modelerExpressionFormatString() const override;
858  private:
859 
860  QComboBox *mComboBox = nullptr;
861  QgsProcessingEnumPanelWidget *mPanel = nullptr;
862  QgsProcessingEnumCheckboxPanelWidget *mCheckboxPanel = nullptr;
863 
864  friend class TestProcessingGui;
865 };
866 
867 
868 
869 class GUI_EXPORT QgsProcessingLayoutWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
870 {
871  Q_OBJECT
872 
873  public:
874 
875  QgsProcessingLayoutWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
876  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
877 
878  // QgsProcessingParameterWidgetFactoryInterface
879  QString parameterType() const override;
881 
882  // QgsProcessingParameterWidgetWrapper interface
883  QWidget *createWidget() override SIP_FACTORY;
884 
885  protected:
886 
887  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
888  QVariant widgetValue() const override;
889  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
890 
891  QStringList compatibleParameterTypes() const override;
892 
893  QStringList compatibleOutputTypes() const override;
894 
895  QString modelerExpressionFormatString() const override;
896  private:
897 
898  QgsLayoutComboBox *mComboBox = nullptr;
899  QComboBox *mPlainComboBox = nullptr;
900 
901  friend class TestProcessingGui;
902 };
903 
904 
905 
906 class GUI_EXPORT QgsProcessingLayoutItemParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
907 {
908  Q_OBJECT
909  public:
910 
911  QgsProcessingLayoutItemParameterDefinitionWidget( QgsProcessingContext &context,
912  const QgsProcessingParameterWidgetContext &widgetContext,
913  const QgsProcessingParameterDefinition *definition = nullptr,
914  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
915  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
916 
917  private:
918 
919  QComboBox *mParentLayoutComboBox = nullptr;
920 
921 };
922 
923 class GUI_EXPORT QgsProcessingLayoutItemWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
924 {
925  Q_OBJECT
926 
927  public:
928 
929  QgsProcessingLayoutItemWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
930  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
931 
932  // QgsProcessingParameterWidgetFactoryInterface
933  QString parameterType() const override;
936  QgsProcessingContext &context,
937  const QgsProcessingParameterWidgetContext &widgetContext,
938  const QgsProcessingParameterDefinition *definition = nullptr,
939  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
940 
941  // QgsProcessingParameterWidgetWrapper interface
942  QWidget *createWidget() override SIP_FACTORY;
943  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
944 
945 
946  public slots:
947  void setLayoutParameterValue( const QVariant &value );
948  void setLayout( QgsPrintLayout *layout );
949 
950  protected:
951 
952  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
953  QVariant widgetValue() const override;
954 
955  QStringList compatibleParameterTypes() const override;
956 
957  QStringList compatibleOutputTypes() const override;
958  QString modelerExpressionFormatString() const override;
959  private:
960 
961  QgsLayoutItemComboBox *mComboBox = nullptr;
962  QLineEdit *mLineEdit = nullptr;
963 
964  friend class TestProcessingGui;
965 };
966 
967 class GUI_EXPORT QgsProcessingPointMapTool : public QgsMapTool
968 {
969  Q_OBJECT
970  public:
971  QgsProcessingPointMapTool( QgsMapCanvas *canvas );
972  ~QgsProcessingPointMapTool() override;
973  void deactivate() override;
974  void canvasMoveEvent( QgsMapMouseEvent *e ) override;
975  void canvasPressEvent( QgsMapMouseEvent *e ) override;
976  void keyPressEvent( QKeyEvent *e ) override;
977 
978  signals:
979 
980  void clicked( const QgsPointXY &point );
981  void complete();
982 
983  private:
984 
985  std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
986  friend class TestProcessingGui;
987 };
988 
989 class GUI_EXPORT QgsProcessingPointPanel : public QWidget
990 {
991  Q_OBJECT
992 
993  public:
994 
995  QgsProcessingPointPanel( QWidget *parent );
996  void setMapCanvas( QgsMapCanvas *canvas );
997  void setAllowNull( bool allowNull );
998 
999  QVariant value() const;
1000  void clear();
1001  void setValue( const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs );
1002 
1003  signals:
1004 
1005  void toggleDialogVisibility( bool visible );
1006  void changed();
1007 
1008  private slots:
1009 
1010  void selectOnCanvas();
1011  void updatePoint( const QgsPointXY &point );
1012  void pointPicked();
1013 
1014  private:
1015 
1016  QgsFilterLineEdit *mLineEdit = nullptr;
1017  QToolButton *mButton = nullptr;
1018  QgsMapCanvas *mCanvas = nullptr;
1020  QPointer< QgsMapTool > mPrevTool;
1021  std::unique_ptr< QgsProcessingPointMapTool > mTool;
1022  friend class TestProcessingGui;
1023 };
1024 
1025 
1026 class GUI_EXPORT QgsProcessingPointParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1027 {
1028  Q_OBJECT
1029  public:
1030 
1031  QgsProcessingPointParameterDefinitionWidget( QgsProcessingContext &context,
1032  const QgsProcessingParameterWidgetContext &widgetContext,
1033  const QgsProcessingParameterDefinition *definition = nullptr,
1034  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1035  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1036 
1037  private:
1038 
1039  QLineEdit *mDefaultLineEdit = nullptr;
1040 
1041 };
1042 
1043 class GUI_EXPORT QgsProcessingPointWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1044 {
1045  Q_OBJECT
1046 
1047  public:
1048 
1049  QgsProcessingPointWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1050  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1051 
1052  // QgsProcessingParameterWidgetFactoryInterface
1053  QString parameterType() const override;
1056  QgsProcessingContext &context,
1057  const QgsProcessingParameterWidgetContext &widgetContext,
1058  const QgsProcessingParameterDefinition *definition = nullptr,
1059  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1060 
1061  // QgsProcessingParameterWidgetWrapper interface
1062  QWidget *createWidget() override SIP_FACTORY;
1063  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
1064  void setDialog( QDialog *dialog ) override;
1065 
1066  protected:
1067 
1068  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1069  QVariant widgetValue() const override;
1070 
1071  QStringList compatibleParameterTypes() const override;
1072 
1073  QStringList compatibleOutputTypes() const override;
1074  QString modelerExpressionFormatString() const override;
1075  private:
1076 
1077  QgsProcessingPointPanel *mPanel = nullptr;
1078  QLineEdit *mLineEdit = nullptr;
1079  QDialog *mDialog = nullptr;
1080 
1081  friend class TestProcessingGui;
1082 };
1083 
1084 class GUI_EXPORT QgsProcessingGeometryParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1085 {
1086  Q_OBJECT
1087  public:
1088 
1089  QgsProcessingGeometryParameterDefinitionWidget( QgsProcessingContext &context,
1090  const QgsProcessingParameterWidgetContext &widgetContext,
1091  const QgsProcessingParameterDefinition *definition = nullptr,
1092  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1093  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1094 
1095  private:
1096 
1097  QLineEdit *mDefaultLineEdit = nullptr;
1098 
1099 };
1100 
1101 class GUI_EXPORT QgsProcessingGeometryWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1102 {
1103  Q_OBJECT
1104 
1105  public:
1106 
1107  QgsProcessingGeometryWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1108  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1109 
1110  // QgsProcessingParameterWidgetFactoryInterface
1111  QString parameterType() const override;
1114  QgsProcessingContext &context,
1115  const QgsProcessingParameterWidgetContext &widgetContext,
1116  const QgsProcessingParameterDefinition *definition = nullptr,
1117  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1118 
1119  // QgsProcessingParameterWidgetWrapper interface
1120  QWidget *createWidget() override SIP_FACTORY;
1121 
1122  protected:
1123 
1124  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1125  QVariant widgetValue() const override;
1126 
1127  QStringList compatibleParameterTypes() const override;
1128 
1129  QStringList compatibleOutputTypes() const override;
1130  QString modelerExpressionFormatString() const override;
1131  private:
1132 
1133  QLineEdit *mLineEdit = nullptr;
1134 
1135  friend class TestProcessingGui;
1136 };
1137 
1138 class GUI_EXPORT QgsProcessingExtentParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1139 {
1140  Q_OBJECT
1141  public:
1142 
1143  QgsProcessingExtentParameterDefinitionWidget( QgsProcessingContext &context,
1144  const QgsProcessingParameterWidgetContext &widgetContext,
1145  const QgsProcessingParameterDefinition *definition = nullptr,
1146  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1147  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1148 
1149  private:
1150 
1151  QgsExtentWidget *mDefaultWidget = nullptr;
1152 
1153 };
1154 
1155 class GUI_EXPORT QgsProcessingExtentWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1156 {
1157  Q_OBJECT
1158 
1159  public:
1160 
1161  QgsProcessingExtentWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1162  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1163 
1164  // QgsProcessingParameterWidgetFactoryInterface
1165  QString parameterType() const override;
1168  QgsProcessingContext &context,
1169  const QgsProcessingParameterWidgetContext &widgetContext,
1170  const QgsProcessingParameterDefinition *definition = nullptr,
1171  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1172 
1173  // QgsProcessingParameterWidgetWrapper interface
1174  QWidget *createWidget() override SIP_FACTORY;
1175  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
1176  void setDialog( QDialog *dialog ) override;
1177 
1178  protected:
1179 
1180  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1181  QVariant widgetValue() const override;
1182 
1183  QStringList compatibleParameterTypes() const override;
1184 
1185  QStringList compatibleOutputTypes() const override;
1186  QString modelerExpressionFormatString() const override;
1187  private:
1188 
1189  QgsExtentWidget *mExtentWidget = nullptr;
1190  QDialog *mDialog = nullptr;
1191 
1192  friend class TestProcessingGui;
1193 };
1194 
1195 class GUI_EXPORT QgsProcessingColorParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1196 {
1197  Q_OBJECT
1198  public:
1199 
1200  QgsProcessingColorParameterDefinitionWidget( QgsProcessingContext &context,
1201  const QgsProcessingParameterWidgetContext &widgetContext,
1202  const QgsProcessingParameterDefinition *definition = nullptr,
1203  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1204  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1205 
1206  private:
1207 
1208  QgsColorButton *mDefaultColorButton = nullptr;
1209  QCheckBox *mAllowOpacity = nullptr;
1210 
1211 };
1212 
1213 class GUI_EXPORT QgsProcessingColorWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1214 {
1215  Q_OBJECT
1216 
1217  public:
1218 
1219  QgsProcessingColorWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1220  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1221 
1222  // QgsProcessingParameterWidgetFactoryInterface
1223  QString parameterType() const override;
1226  QgsProcessingContext &context,
1227  const QgsProcessingParameterWidgetContext &widgetContext,
1228  const QgsProcessingParameterDefinition *definition = nullptr,
1229  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1230 
1231  // QgsProcessingParameterWidgetWrapper interface
1232  QWidget *createWidget() override SIP_FACTORY;
1233 
1234  protected:
1235 
1236  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1237  QVariant widgetValue() const override;
1238 
1239  QStringList compatibleParameterTypes() const override;
1240 
1241  QStringList compatibleOutputTypes() const override;
1242  QString modelerExpressionFormatString() const override;
1243  private:
1244 
1245  QgsColorButton *mColorButton = nullptr;
1246  friend class TestProcessingGui;
1247 };
1248 
1249 
1250 
1251 class GUI_EXPORT QgsProcessingCoordinateOperationParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1252 {
1253  Q_OBJECT
1254  public:
1255 
1256  QgsProcessingCoordinateOperationParameterDefinitionWidget( QgsProcessingContext &context,
1257  const QgsProcessingParameterWidgetContext &widgetContext,
1258  const QgsProcessingParameterDefinition *definition = nullptr,
1259  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1260  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1261 
1262  private:
1263 
1264  QLineEdit *mDefaultLineEdit = nullptr;
1265 
1266  QComboBox *mSourceParamComboBox = nullptr;
1267  QComboBox *mDestParamComboBox = nullptr;
1268 
1269  QgsProjectionSelectionWidget *mStaticSourceWidget = nullptr;
1270  QgsProjectionSelectionWidget *mStaticDestWidget = nullptr;
1271 
1272 
1273 };
1274 
1275 class GUI_EXPORT QgsProcessingCoordinateOperationWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1276 {
1277  Q_OBJECT
1278 
1279  public:
1280 
1281  QgsProcessingCoordinateOperationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1282  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1283 
1284  // QgsProcessingParameterWidgetFactoryInterface
1285  QString parameterType() const override;
1288  QgsProcessingContext &context,
1289  const QgsProcessingParameterWidgetContext &widgetContext,
1290  const QgsProcessingParameterDefinition *definition = nullptr,
1291  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1292 
1293  // QgsProcessingParameterWidgetWrapper interface
1294  QWidget *createWidget() override SIP_FACTORY;
1295  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
1296  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
1297  protected:
1298 
1299  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1300  QVariant widgetValue() const override;
1301 
1302  QStringList compatibleParameterTypes() const override;
1303 
1304  QStringList compatibleOutputTypes() const override;
1305  QString modelerExpressionFormatString() const override;
1306  private:
1307 
1308  void setSourceCrsParameterValue( const QVariant &value );
1309  void setDestinationCrsParameterValue( const QVariant &value );
1310 
1311  QgsCoordinateOperationWidget *mOperationWidget = nullptr;
1312  QgsMapCanvas *mCanvas = nullptr;
1313  QLineEdit *mLineEdit = nullptr;
1314  QgsCoordinateReferenceSystem mSourceCrs;
1316  friend class TestProcessingGui;
1317 };
1318 
1319 class GUI_EXPORT QgsProcessingFieldPanelWidget : public QWidget
1320 {
1321  Q_OBJECT
1322 
1323  public:
1324 
1325  QgsProcessingFieldPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterField *param = nullptr );
1326 
1327  void setFields( const QgsFields &fields );
1328 
1329  QgsFields fields() const { return mFields; }
1330 
1331  QVariant value() const { return mValue; }
1332  void setValue( const QVariant &value );
1333 
1334  signals:
1335 
1336  void changed();
1337 
1338  private slots:
1339 
1340  void showDialog();
1341 
1342  private:
1343 
1344  void updateSummaryText();
1345 
1346  QgsFields mFields;
1347 
1348  const QgsProcessingParameterField *mParam = nullptr;
1349  QLineEdit *mLineEdit = nullptr;
1350  QToolButton *mToolButton = nullptr;
1351 
1352  QVariantList mValue;
1353 
1354  friend class TestProcessingGui;
1355 };
1356 
1357 class GUI_EXPORT QgsProcessingFieldParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1358 {
1359  Q_OBJECT
1360  public:
1361 
1362  QgsProcessingFieldParameterDefinitionWidget( QgsProcessingContext &context,
1363  const QgsProcessingParameterWidgetContext &widgetContext,
1364  const QgsProcessingParameterDefinition *definition = nullptr,
1365  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1366  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1367 
1368  private:
1369 
1370  QComboBox *mParentLayerComboBox = nullptr;
1371  QComboBox *mDataTypeComboBox = nullptr;
1372  QLineEdit *mDefaultLineEdit = nullptr;
1373  QCheckBox *mAllowMultipleCheckBox = nullptr;
1374  QCheckBox *mDefaultToAllCheckBox = nullptr;
1375 };
1376 
1377 class GUI_EXPORT QgsProcessingFieldWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1378 {
1379  Q_OBJECT
1380 
1381  public:
1382 
1383  QgsProcessingFieldWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1384  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1385 
1386  // QgsProcessingParameterWidgetFactoryInterface
1387  QString parameterType() const override;
1390  QgsProcessingContext &context,
1391  const QgsProcessingParameterWidgetContext &widgetContext,
1392  const QgsProcessingParameterDefinition *definition = nullptr,
1393  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1394 
1395  // QgsProcessingParameterWidgetWrapper interface
1396  QWidget *createWidget() override SIP_FACTORY;
1397  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
1398 
1399  public slots:
1400  void setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
1401 
1402  protected:
1403 
1404  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1405  QVariant widgetValue() const override;
1406 
1407  QStringList compatibleParameterTypes() const override;
1408 
1409  QStringList compatibleOutputTypes() const override;
1410  QString modelerExpressionFormatString() const override;
1411  const QgsVectorLayer *linkedVectorLayer() const override;
1412 
1413  private:
1414 
1415  QgsFieldComboBox *mComboBox = nullptr;
1416  QgsProcessingFieldPanelWidget *mPanel = nullptr;
1417  QLineEdit *mLineEdit = nullptr;
1418 
1419  std::unique_ptr< QgsVectorLayer > mParentLayer;
1420 
1421  QgsFields filterFields( const QgsFields &fields ) const;
1422 
1423  friend class TestProcessingGui;
1424 };
1425 
1426 
1427 class GUI_EXPORT QgsProcessingMapThemeParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1428 {
1429  Q_OBJECT
1430  public:
1431 
1432  QgsProcessingMapThemeParameterDefinitionWidget( QgsProcessingContext &context,
1433  const QgsProcessingParameterWidgetContext &widgetContext,
1434  const QgsProcessingParameterDefinition *definition = nullptr,
1435  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1436  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1437 
1438  private:
1439 
1440  QComboBox *mDefaultComboBox = nullptr;
1441 
1442 };
1443 
1444 class GUI_EXPORT QgsProcessingMapThemeWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1445 {
1446  Q_OBJECT
1447 
1448  public:
1449 
1450  QgsProcessingMapThemeWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1451  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1452 
1453  // QgsProcessingParameterWidgetFactoryInterface
1454  QString parameterType() const override;
1457  QgsProcessingContext &context,
1458  const QgsProcessingParameterWidgetContext &widgetContext,
1459  const QgsProcessingParameterDefinition *definition = nullptr,
1460  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1461 
1462  // QgsProcessingParameterWidgetWrapper interface
1463  QWidget *createWidget() override SIP_FACTORY;
1464 
1465  protected:
1466 
1467  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1468  QVariant widgetValue() const override;
1469 
1470  QStringList compatibleParameterTypes() const override;
1471 
1472  QStringList compatibleOutputTypes() const override;
1473  QString modelerExpressionFormatString() const override;
1474 
1475  private:
1476 
1477  QComboBox *mComboBox = nullptr;
1478 
1479  friend class TestProcessingGui;
1480 };
1481 
1482 
1483 class GUI_EXPORT QgsProcessingDateTimeParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1484 {
1485  Q_OBJECT
1486  public:
1487 
1488  QgsProcessingDateTimeParameterDefinitionWidget( QgsProcessingContext &context,
1489  const QgsProcessingParameterWidgetContext &widgetContext,
1490  const QgsProcessingParameterDefinition *definition = nullptr,
1491  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1492  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1493 
1494  private:
1495 
1496  QComboBox *mTypeComboBox = nullptr;
1497 
1498 };
1499 
1500 class GUI_EXPORT QgsProcessingDateTimeWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1501 {
1502  Q_OBJECT
1503 
1504  public:
1505 
1506  QgsProcessingDateTimeWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1507  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1508 
1509  // QgsProcessingParameterWidgetFactoryInterface
1510  QString parameterType() const override;
1512 
1513  // QgsProcessingParameterWidgetWrapper interface
1514  QWidget *createWidget() override SIP_FACTORY;
1515  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1516  QgsProcessingContext &context,
1517  const QgsProcessingParameterWidgetContext &widgetContext,
1518  const QgsProcessingParameterDefinition *definition = nullptr,
1519  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1520 
1521  protected:
1522 
1523  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1524  QVariant widgetValue() const override;
1525 
1526  QStringList compatibleParameterTypes() const override;
1527  QStringList compatibleOutputTypes() const override;
1528  QString modelerExpressionFormatString() const override;
1529 
1530  private:
1531 
1532  QgsDateTimeEdit *mDateTimeEdit = nullptr;
1533  QgsDateEdit *mDateEdit = nullptr;
1534  QgsTimeEdit *mTimeEdit = nullptr;
1535 
1536  friend class TestProcessingGui;
1537 };
1538 
1539 
1540 
1541 //
1542 // QgsProcessingProviderConnectionWidgetWrapper
1543 //
1544 
1545 class GUI_EXPORT QgsProcessingProviderConnectionParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1546 {
1547  Q_OBJECT
1548  public:
1549 
1550  QgsProcessingProviderConnectionParameterDefinitionWidget( QgsProcessingContext &context,
1551  const QgsProcessingParameterWidgetContext &widgetContext,
1552  const QgsProcessingParameterDefinition *definition = nullptr,
1553  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1554  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1555 
1556  private:
1557 
1558  QComboBox *mProviderComboBox = nullptr;
1559  QLineEdit *mDefaultEdit = nullptr;
1560 
1561 };
1562 
1563 class GUI_EXPORT QgsProcessingProviderConnectionWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1564 {
1565  Q_OBJECT
1566 
1567  public:
1568 
1569  QgsProcessingProviderConnectionWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1570  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1571 
1572  // QgsProcessingParameterWidgetFactoryInterface
1573  QString parameterType() const override;
1575 
1576 
1577  // QgsProcessingParameterWidgetWrapper interface
1578  QWidget *createWidget() override SIP_FACTORY;
1579  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1580  QgsProcessingContext &context,
1581  const QgsProcessingParameterWidgetContext &widgetContext,
1582  const QgsProcessingParameterDefinition *definition = nullptr,
1583  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1584 
1585  protected:
1586 
1587  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1588  QVariant widgetValue() const override;
1589 
1590  QStringList compatibleParameterTypes() const override;
1591 
1592  QStringList compatibleOutputTypes() const override;
1593  QString modelerExpressionFormatString() const override;
1594 
1595  private:
1596 
1597  QgsProviderConnectionComboBox *mProviderComboBox = nullptr;
1598  int mBlockSignals = 0;
1599 
1600  friend class TestProcessingGui;
1601 };
1602 
1603 
1604 
1605 class GUI_EXPORT QgsProcessingDatabaseSchemaParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1606 {
1607  Q_OBJECT
1608  public:
1609 
1610  QgsProcessingDatabaseSchemaParameterDefinitionWidget( QgsProcessingContext &context,
1611  const QgsProcessingParameterWidgetContext &widgetContext,
1612  const QgsProcessingParameterDefinition *definition = nullptr,
1613  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1614  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1615 
1616  private:
1617 
1618  QComboBox *mConnectionParamComboBox = nullptr;
1619  QLineEdit *mDefaultEdit = nullptr;
1620 
1621 };
1622 
1623 class GUI_EXPORT QgsProcessingDatabaseSchemaWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1624 {
1625  Q_OBJECT
1626 
1627  public:
1628 
1629  QgsProcessingDatabaseSchemaWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1630  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1631 
1632  // QgsProcessingParameterWidgetFactoryInterface
1633  QString parameterType() const override;
1635  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
1636 
1637 
1638  // QgsProcessingParameterWidgetWrapper interface
1639  QWidget *createWidget() override SIP_FACTORY;
1640  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1641  QgsProcessingContext &context,
1642  const QgsProcessingParameterWidgetContext &widgetContext,
1643  const QgsProcessingParameterDefinition *definition = nullptr,
1644  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1645 
1646  public slots:
1647  void setParentConnectionWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
1648 
1649  protected:
1650 
1651  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1652  QVariant widgetValue() const override;
1653 
1654  QStringList compatibleParameterTypes() const override;
1655 
1656  QStringList compatibleOutputTypes() const override;
1657  QString modelerExpressionFormatString() const override;
1658 
1659  private:
1660 
1661  QgsDatabaseSchemaComboBox *mSchemaComboBox = nullptr;
1662  int mBlockSignals = 0;
1663 
1664  friend class TestProcessingGui;
1665 };
1666 
1667 
1668 
1669 
1670 class GUI_EXPORT QgsProcessingDatabaseTableParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1671 {
1672  Q_OBJECT
1673  public:
1674 
1675  QgsProcessingDatabaseTableParameterDefinitionWidget( QgsProcessingContext &context,
1676  const QgsProcessingParameterWidgetContext &widgetContext,
1677  const QgsProcessingParameterDefinition *definition = nullptr,
1678  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1679  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1680 
1681  private:
1682 
1683  QComboBox *mConnectionParamComboBox = nullptr;
1684  QComboBox *mSchemaParamComboBox = nullptr;
1685  QLineEdit *mDefaultEdit = nullptr;
1686 
1687 };
1688 
1689 class GUI_EXPORT QgsProcessingDatabaseTableWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1690 {
1691  Q_OBJECT
1692 
1693  public:
1694 
1695  QgsProcessingDatabaseTableWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1696  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1697 
1698  // QgsProcessingParameterWidgetFactoryInterface
1699  QString parameterType() const override;
1701  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
1702 
1703 
1704  // QgsProcessingParameterWidgetWrapper interface
1705  QWidget *createWidget() override SIP_FACTORY;
1706  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1707  QgsProcessingContext &context,
1708  const QgsProcessingParameterWidgetContext &widgetContext,
1709  const QgsProcessingParameterDefinition *definition = nullptr,
1710  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1711 
1712  public slots:
1713  void setParentConnectionWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
1714  void setParentSchemaWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
1715 
1716  protected:
1717 
1718  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1719  QVariant widgetValue() const override;
1720 
1721  QStringList compatibleParameterTypes() const override;
1722 
1723  QStringList compatibleOutputTypes() const override;
1724  QString modelerExpressionFormatString() const override;
1725 
1726  private:
1727 
1728  QgsDatabaseTableComboBox *mTableComboBox = nullptr;
1729  int mBlockSignals = 0;
1730  QString mConnection;
1731  QString mProvider;
1732  QString mSchema;
1733 
1734  friend class TestProcessingGui;
1735 };
1736 
1737 class GUI_EXPORT QgsProcessingMapLayerParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1738 {
1739  Q_OBJECT
1740  public:
1741 
1742  QgsProcessingMapLayerParameterDefinitionWidget( QgsProcessingContext &context,
1743  const QgsProcessingParameterWidgetContext &widgetContext,
1744  const QgsProcessingParameterDefinition *definition = nullptr,
1745  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1746  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1747 
1748  private:
1749 
1750  QgsCheckableComboBox *mLayerTypeComboBox = nullptr;
1751 };
1752 
1753 class GUI_EXPORT QgsProcessingMapLayerWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1754 {
1755  Q_OBJECT
1756 
1757  public:
1758 
1759  QgsProcessingMapLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1760  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1761 
1762  // QgsProcessingParameterWidgetFactoryInterface
1763  QString parameterType() const override;
1766  QgsProcessingContext &context,
1767  const QgsProcessingParameterWidgetContext &widgetContext,
1768  const QgsProcessingParameterDefinition *definition = nullptr,
1769  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1770 
1771  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
1772  // QgsProcessingParameterWidgetWrapper interface
1773  QWidget *createWidget() override SIP_FACTORY;
1774  protected:
1775 
1776  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
1777  QVariant widgetValue() const override;
1778 
1779  QStringList compatibleParameterTypes() const override;
1780 
1781  QStringList compatibleOutputTypes() const override;
1782  QString modelerExpressionFormatString() const override;
1783  QgsProcessingModelChildParameterSource::Source defaultModelSource( const QgsProcessingParameterDefinition *parameter ) const override;
1784 
1785  private:
1786 
1787  QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1788  int mBlockSignals = 0;
1789 
1790  friend class TestProcessingGui;
1791 };
1792 
1793 
1794 class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1795 {
1796  Q_OBJECT
1797 
1798  public:
1799 
1800  QgsProcessingRasterLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1801  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1802 
1803  // QgsProcessingParameterWidgetFactoryInterface
1804  QString parameterType() const override;
1807  QgsProcessingContext &context,
1808  const QgsProcessingParameterWidgetContext &widgetContext,
1809  const QgsProcessingParameterDefinition *definition = nullptr,
1810  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1811 
1812  protected:
1813  QStringList compatibleParameterTypes() const override;
1814 
1815  QStringList compatibleOutputTypes() const override;
1816 
1817  QString modelerExpressionFormatString() const override;
1818 
1819 };
1820 
1821 
1822 class GUI_EXPORT QgsProcessingVectorLayerParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1823 {
1824  Q_OBJECT
1825  public:
1826 
1827  QgsProcessingVectorLayerParameterDefinitionWidget( QgsProcessingContext &context,
1828  const QgsProcessingParameterWidgetContext &widgetContext,
1829  const QgsProcessingParameterDefinition *definition = nullptr,
1830  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1831  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1832 
1833  private:
1834 
1835  QgsCheckableComboBox *mGeometryTypeComboBox = nullptr;
1836 };
1837 
1838 class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1839 {
1840  Q_OBJECT
1841 
1842  public:
1843 
1844  QgsProcessingVectorLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1845  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1846 
1847  // QgsProcessingParameterWidgetFactoryInterface
1848  QString parameterType() const override;
1850  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1851  QgsProcessingContext &context,
1852  const QgsProcessingParameterWidgetContext &widgetContext,
1853  const QgsProcessingParameterDefinition *definition = nullptr,
1854  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1855 
1856  protected:
1857  QStringList compatibleParameterTypes() const override;
1858 
1859  QStringList compatibleOutputTypes() const override;
1860 
1861  QString modelerExpressionFormatString() const override;
1862  QList< int > compatibleDataTypes( const QgsProcessingParameterDefinition *parameter ) const override;
1863 };
1864 
1865 
1866 class GUI_EXPORT QgsProcessingFeatureSourceParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1867 {
1868  Q_OBJECT
1869  public:
1870 
1871  QgsProcessingFeatureSourceParameterDefinitionWidget( QgsProcessingContext &context,
1872  const QgsProcessingParameterWidgetContext &widgetContext,
1873  const QgsProcessingParameterDefinition *definition = nullptr,
1874  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1875  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1876 
1877  private:
1878 
1879  QgsCheckableComboBox *mGeometryTypeComboBox = nullptr;
1880 };
1881 
1882 class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1883 {
1884  Q_OBJECT
1885 
1886  public:
1887 
1888  QgsProcessingFeatureSourceWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1889  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1890 
1891  // QgsProcessingParameterWidgetFactoryInterface
1892  QString parameterType() const override;
1894  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1895  QgsProcessingContext &context,
1896  const QgsProcessingParameterWidgetContext &widgetContext,
1897  const QgsProcessingParameterDefinition *definition = nullptr,
1898  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1899 
1900  protected:
1901  QStringList compatibleParameterTypes() const override;
1902 
1903  QStringList compatibleOutputTypes() const override;
1904 
1905  QString modelerExpressionFormatString() const override;
1906  QList< int > compatibleDataTypes( const QgsProcessingParameterDefinition *parameter ) const override;
1907 };
1908 
1909 
1910 class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1911 {
1912  Q_OBJECT
1913 
1914  public:
1915 
1916  QgsProcessingMeshLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1917  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1918 
1919  // QgsProcessingParameterWidgetFactoryInterface
1920  QString parameterType() const override;
1922  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1923  QgsProcessingContext &context,
1924  const QgsProcessingParameterWidgetContext &widgetContext,
1925  const QgsProcessingParameterDefinition *definition = nullptr,
1926  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1927 
1928  protected:
1929  QStringList compatibleParameterTypes() const override;
1930 
1931  QStringList compatibleOutputTypes() const override;
1932 
1933  QString modelerExpressionFormatString() const override;
1934 
1935 };
1936 
1937 
1938 class GUI_EXPORT QgsProcessingRasterBandPanelWidget : public QWidget
1939 {
1940  Q_OBJECT
1941 
1942  public:
1943 
1944  QgsProcessingRasterBandPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterBand *param = nullptr );
1945 
1946  void setBands( const QList< int > &bands );
1947  void setBandNames( const QHash<int, QString > &names );
1948  QList< int > bands() const { return mBands; }
1949 
1950  QVariant value() const { return mValue; }
1951  void setValue( const QVariant &value );
1952 
1953  signals:
1954 
1955  void changed();
1956 
1957  private slots:
1958 
1959  void showDialog();
1960 
1961  private:
1962 
1963  void updateSummaryText();
1964 
1965  QList< int > mBands;
1966  QHash<int, QString > mBandNames;
1967 
1968  const QgsProcessingParameterBand *mParam = nullptr;
1969  QLineEdit *mLineEdit = nullptr;
1970  QToolButton *mToolButton = nullptr;
1971 
1972  QVariantList mValue;
1973 
1974  friend class TestProcessingGui;
1975 };
1976 
1977 class GUI_EXPORT QgsProcessingBandParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1978 {
1979  Q_OBJECT
1980  public:
1981 
1982  QgsProcessingBandParameterDefinitionWidget( QgsProcessingContext &context,
1983  const QgsProcessingParameterWidgetContext &widgetContext,
1984  const QgsProcessingParameterDefinition *definition = nullptr,
1985  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1986  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1987 
1988  private:
1989 
1990  QComboBox *mParentLayerComboBox = nullptr;
1991  QLineEdit *mDefaultLineEdit = nullptr;
1992  QCheckBox *mAllowMultipleCheckBox = nullptr;
1993 };
1994 
1995 class GUI_EXPORT QgsProcessingBandWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1996 {
1997  Q_OBJECT
1998 
1999  public:
2000 
2001  QgsProcessingBandWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2002  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2003 
2004  // QgsProcessingParameterWidgetFactoryInterface
2005  QString parameterType() const override;
2008  QgsProcessingContext &context,
2009  const QgsProcessingParameterWidgetContext &widgetContext,
2010  const QgsProcessingParameterDefinition *definition = nullptr,
2011  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2012 
2013  // QgsProcessingParameterWidgetWrapper interface
2014  QWidget *createWidget() override SIP_FACTORY;
2015  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
2016 
2017  public slots:
2018  void setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
2019 
2020  protected:
2021 
2022  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2023  QVariant widgetValue() const override;
2024 
2025  QStringList compatibleParameterTypes() const override;
2026 
2027  QStringList compatibleOutputTypes() const override;
2028  QString modelerExpressionFormatString() const override;
2029 
2030  private:
2031 
2032  QgsRasterBandComboBox *mComboBox = nullptr;
2033  QgsProcessingRasterBandPanelWidget *mPanel = nullptr;
2034  QLineEdit *mLineEdit = nullptr;
2035 
2036  std::unique_ptr< QgsRasterLayer > mParentLayer;
2037 
2038  friend class TestProcessingGui;
2039 };
2040 
2041 
2042 
2043 class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
2044 {
2045  Q_OBJECT
2046 
2047  public:
2048 
2049  QgsProcessingMultipleLayerPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterMultipleLayers *param = nullptr );
2050 
2051  QVariant value() const { return mValue; }
2052  void setValue( const QVariant &value );
2053 
2054  void setProject( QgsProject *project );
2055  void setModel( QgsProcessingModelAlgorithm *model, const QString &modelChildAlgorithmID );
2056 
2057  signals:
2058 
2059  void changed();
2060 
2061  private slots:
2062 
2063  void showDialog();
2064 
2065  private:
2066 
2067  void updateSummaryText();
2068 
2069  const QgsProcessingParameterMultipleLayers *mParam = nullptr;
2070  QLineEdit *mLineEdit = nullptr;
2071  QToolButton *mToolButton = nullptr;
2072 
2073  QVariantList mValue;
2074  QList< QgsProcessingModelChildParameterSource > mModelSources;
2075  QgsProcessingModelAlgorithm *mModel = nullptr;
2076 
2077  QgsProject *mProject = nullptr;
2078 
2079  friend class TestProcessingGui;
2080 };
2081 
2082 class GUI_EXPORT QgsProcessingMultipleLayerParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
2083 {
2084  Q_OBJECT
2085  public:
2086 
2087  QgsProcessingMultipleLayerParameterDefinitionWidget( QgsProcessingContext &context,
2088  const QgsProcessingParameterWidgetContext &widgetContext,
2089  const QgsProcessingParameterDefinition *definition = nullptr,
2090  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
2091  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
2092 
2093  private:
2094 
2095  QComboBox *mLayerTypeComboBox = nullptr;
2096 };
2097 
2098 class GUI_EXPORT QgsProcessingMultipleLayerWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2099 {
2100  Q_OBJECT
2101 
2102  public:
2103 
2104  QgsProcessingMultipleLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2105  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2106 
2107  // QgsProcessingParameterWidgetFactoryInterface
2108  QString parameterType() const override;
2111  QgsProcessingContext &context,
2112  const QgsProcessingParameterWidgetContext &widgetContext,
2113  const QgsProcessingParameterDefinition *definition = nullptr,
2114  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2115 
2116  // QgsProcessingParameterWidgetWrapper interface
2117  QWidget *createWidget() override SIP_FACTORY;
2118  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
2119 
2120  protected:
2121 
2122  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2123  QVariant widgetValue() const override;
2124 
2125  QStringList compatibleParameterTypes() const override;
2126 
2127  QStringList compatibleOutputTypes() const override;
2128  QString modelerExpressionFormatString() const override;
2129 
2130  private:
2131 
2132  QgsProcessingMultipleLayerPanelWidget *mPanel = nullptr;
2133 
2134  friend class TestProcessingGui;
2135 };
2136 
2137 
2138 
2139 class GUI_EXPORT QgsProcessingOutputWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2140 {
2141  Q_OBJECT
2142 
2143  public:
2144 
2145  QgsProcessingOutputWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2146  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2147 
2148  // QgsProcessingParameterWidgetWrapper interface
2149  QWidget *createWidget() override SIP_FACTORY;
2150  protected:
2151 
2152  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2153  QVariant widgetValue() const override;
2154  QVariantMap customProperties() const override;
2155 
2156  QStringList compatibleParameterTypes() const override;
2157 
2158  QStringList compatibleOutputTypes() const override;
2159 
2160  private:
2161 
2162  QgsProcessingLayerOutputDestinationWidget *mOutputWidget = nullptr;
2163  int mBlockSignals = 0;
2164 
2165  friend class TestProcessingGui;
2166 };
2167 
2168 
2169 class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2170 {
2171  Q_OBJECT
2172 
2173  public:
2174 
2175  QgsProcessingFeatureSinkWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2176  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2177 
2178  // QgsProcessingParameterWidgetFactoryInterface
2179  QString parameterType() const override;
2181 
2182  protected:
2183  QString modelerExpressionFormatString() const override;
2184 
2185  private:
2186  QgsProcessingContext mContext;
2187 
2188 };
2189 
2190 class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2191 {
2192  Q_OBJECT
2193 
2194  public:
2195 
2196  QgsProcessingVectorDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2197  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2198 
2199  // QgsProcessingParameterWidgetFactoryInterface
2200  QString parameterType() const override;
2202 
2203  protected:
2204  QString modelerExpressionFormatString() const override;
2205 
2206 };
2207 
2208 class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2209 {
2210  Q_OBJECT
2211 
2212  public:
2213 
2214  QgsProcessingRasterDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2215  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2216 
2217  // QgsProcessingParameterWidgetFactoryInterface
2218  QString parameterType() const override;
2220 
2221  protected:
2222  QString modelerExpressionFormatString() const override;
2223 
2224 };
2225 
2226 class GUI_EXPORT QgsProcessingPointCloudDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2227 {
2228  Q_OBJECT
2229 
2230  public:
2231 
2232  QgsProcessingPointCloudDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2233  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2234 
2235  // QgsProcessingParameterWidgetFactoryInterface
2236  QString parameterType() const override;
2238 
2239  protected:
2240  QString modelerExpressionFormatString() const override;
2241 
2242 };
2243 
2244 class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2245 {
2246  Q_OBJECT
2247 
2248  public:
2249 
2250  QgsProcessingFileDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2251  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2252 
2253  // QgsProcessingParameterWidgetFactoryInterface
2254  QString parameterType() const override;
2256 
2257  protected:
2258  QString modelerExpressionFormatString() const override;
2259 
2260 };
2261 
2262 class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2263 {
2264  Q_OBJECT
2265 
2266  public:
2267 
2268  QgsProcessingFolderDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2269  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2270 
2271  // QgsProcessingParameterWidgetFactoryInterface
2272  QString parameterType() const override;
2274 
2275  protected:
2276  QString modelerExpressionFormatString() const override;
2277 
2278 };
2279 
2280 class GUI_EXPORT QgsProcessingPointCloudLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
2281 {
2282  Q_OBJECT
2283 
2284  public:
2285 
2286  QgsProcessingPointCloudLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2287  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2288 
2289  // QgsProcessingParameterWidgetFactoryInterface
2290  QString parameterType() const override;
2292  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
2293  QgsProcessingContext &context,
2294  const QgsProcessingParameterWidgetContext &widgetContext,
2295  const QgsProcessingParameterDefinition *definition = nullptr,
2296  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2297 
2298  protected:
2299  QStringList compatibleParameterTypes() const override;
2300 
2301  QStringList compatibleOutputTypes() const override;
2302 
2303  QString modelerExpressionFormatString() const override;
2304 
2305 };
2306 
2307 
2308 class GUI_EXPORT QgsProcessingAnnotationLayerWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2309 {
2310  Q_OBJECT
2311 
2312  public:
2313 
2314  QgsProcessingAnnotationLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2315  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2316 
2317  // QgsProcessingParameterWidgetFactoryInterface
2318  QString parameterType() const override;
2321  QgsProcessingContext &context,
2322  const QgsProcessingParameterWidgetContext &widgetContext,
2323  const QgsProcessingParameterDefinition *definition = nullptr,
2324  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2325  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
2326 
2327  QWidget *createWidget() override SIP_FACTORY;
2328  protected:
2329 
2330  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2331  QVariant widgetValue() const override;
2332 
2333  QStringList compatibleParameterTypes() const override;
2334 
2335  QStringList compatibleOutputTypes() const override;
2336 
2337  QString modelerExpressionFormatString() const override;
2338 
2339  private:
2340 
2341  QPointer< QgsMapLayerComboBox > mComboBox;
2342  int mBlockSignals = 0;
2343 
2344  friend class TestProcessingGui;
2345 };
2346 
2347 
2349 
2350 #endif // QGSPROCESSINGWIDGETWRAPPERIMPL_H
QgsDateTimeEdit
The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times.
Definition: qgsdatetimeedit.h:36
QgsProcessingParameterWidgetContext
Contains settings which reflect the context in which a Processing parameter widget is shown,...
Definition: qgsprocessingwidgetwrapper.h:115
QgsLayoutItemComboBox
The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout.
Definition: qgslayoutitemcombobox.h:34
QgsCoordinateOperationWidget
A widget for selecting the coordinate operation to use when transforming between a source and destina...
Definition: qgscoordinateoperationwidget.h:33
QgsAbstractProcessingParameterWidgetWrapper::createWidget
virtual QWidget * createWidget()=0
Creates a new widget which allows customization of the parameter's value.
QgsLayoutComboBox
The QgsLayoutComboBox class is a combo box which displays available layouts from a QgsLayoutManager.
Definition: qgslayoutcombobox.h:30
qgsprocessingparameterdefinitionwidget.h
QgsExpressionBuilderWidget
A reusable widget that can be used to build a expression string. See QgsExpressionBuilderDialog for e...
Definition: qgsexpressionbuilderwidget.h:42
algorithm
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
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:44
QgsAbstractProcessingParameterWidgetWrapper::setWidgetContext
virtual void setWidgetContext(const QgsProcessingParameterWidgetContext &context)
Sets the context in which the Processing parameter widget is shown, e.g., the parent model algorithm,...
Definition: qgsprocessingwidgetwrapper.cpp:121
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsFilterLineEdit
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Definition: qgsfilterlineedit.h:39
QgsProviderConnectionComboBox
The QgsProviderConnectionComboBox class is a combo box which displays the list of connections registe...
Definition: qgsproviderconnectioncombobox.h:49
QgsProjectionSelectionWidget
A widget for selecting a projection.
Definition: qgsprojectionselectionwidget.h:40
QgsProcessingParameterDefinition
Base class for the definition of processing parameters.
Definition: qgsprocessingparameters.h:334
QgsDatabaseSchemaComboBox
The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific ...
Definition: qgsdatabaseschemacombobox.h:50
QgsAbstractProcessingParameterWidgetWrapper
A widget wrapper for Processing parameter value widgets.
Definition: qgsprocessingwidgetwrapper.h:282
QgsProcessingParameterMultipleLayers
A parameter for processing algorithms which accepts multiple map layers.
Definition: qgsprocessingparameters.h:2097
QgsProcessingParameterWidgetFactoryInterface::createWidgetWrapper
virtual QgsAbstractProcessingParameterWidgetWrapper * createWidgetWrapper(const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type)=0
Creates a new widget wrapper for the specified parameter definition.
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:103
QgsSnapIndicator
Class that shows snapping marker on map canvas for the current snapping match.
Definition: qgssnapindicator.h:32
QgsProcessingGui::Standard
@ Standard
Standard algorithm dialog.
Definition: qgsprocessinggui.h:40
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapTool
Abstract base class for all map tools. Map tools are user interactive tools for manipulating the map ...
Definition: qgsmaptool.h:70
geos::unique_ptr
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
QgsDateEdit
The QgsDateEdit class is a QDateEdit widget with the capability of setting/reading null dates.
Definition: qgsdatetimeedit.h:276
QgsPrintLayout
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Definition: qgsprintlayout.h:30
QgsRasterBandComboBox
A combobox widget which displays the bands present in a raster layer.
Definition: qgsrasterbandcombobox.h:34
QgsProcessingParameterWidgetFactoryInterface::modelerExpressionFormatString
virtual QString modelerExpressionFormatString() const
Returns the expected expression format string for expression results for the parameter within model c...
Definition: qgsprocessingwidgetwrapper.cpp:392
QgsProcessingParameterWidgetFactoryInterface::parameterType
virtual QString parameterType() const =0
Returns the type string for the parameter type the factory is associated with.
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition: qgsprocessingcontext.h:46
qgsmaptool.h
QgsProcessingAbstractParameterDefinitionWidget::createParameter
virtual QgsProcessingParameterDefinition * createParameter(const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags) const =0
Returns a new instance of a parameter definition, using the current settings defined in the dialog.
qgsprocessingwidgetwrapper.h
QgsUnitTypes
Helper functions for various unit types.
Definition: qgsunittypes.h:38
QgsFieldComboBox
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer....
Definition: qgsfieldcombobox.h:38
QgsScaleWidget
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...
Definition: qgsscalewidget.h:34
QgsRasterLayer
Represents a raster layer.
Definition: qgsrasterlayer.h:76
QgsAuthConfigSelect::QgsAuthConfigSelect
QgsAuthConfigSelect(QWidget *parent=nullptr, const QString &dataprovider=QString())
Create a dialog for setting an associated authentication config, either from existing configs,...
Definition: qgsauthconfigselect.cpp:34
QgsExtentWidget
A widget for configuration of a map extent.
Definition: qgsextentwidget.h:51
QgsProcessingAbstractParameterDefinitionWidget
Abstract base class for widgets which allow users to specify the properties of a Processing parameter...
Definition: qgsprocessingparameterdefinitionwidget.h:46
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value....
Definition: qgsspinbox.h:42
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:58
QgsTimeEdit
The QgsTimeEdit class is a QTimeEdit widget with the capability of setting/reading null date/times.
Definition: qgsdatetimeedit.h:230
QgsDatabaseTableComboBox
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific da...
Definition: qgsdatabasetablecombobox.h:50
QgsMapLayerComboBox
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
Definition: qgsmaplayercombobox.h:34
QgsMapMouseEvent
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas....
Definition: qgsmapmouseevent.h:35
QgsProcessingGui::WidgetType
WidgetType
Types of dialogs which Processing widgets can be created for.
Definition: qgsprocessinggui.h:38
QgsProcessingParameterWidgetFactoryInterface
An interface for Processing widget wrapper factories.
Definition: qgsprocessingwidgetwrapper.h:532
QgsProcessingAlgorithm
Abstract base class for processing algorithms.
Definition: qgsprocessingalgorithm.h:52
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsColorButton
A cross platform button subclass for selecting colors. Will open a color chooser dialog when clicked....
Definition: qgscolorbutton.h:35
QgsExpressionLineEdit
The QgsExpressionLineEdit widget includes a line edit for entering expressions together with a button...
Definition: qgsexpressionlineedit.h:48
QgsProcessingParameterWidgetFactoryInterface::compatibleOutputTypes
virtual QStringList compatibleOutputTypes() const =0
Returns a list of compatible Processing output types for inputs for this parameter.
QgsDoubleSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value....
Definition: qgsdoublespinbox.h:42
QgsProcessingParameterBand
A raster band parameter for Processing algorithms.
Definition: qgsprocessingparameters.h:3548
qgsprocessingcontext.h
QgsProcessingParameterWidgetFactoryInterface::createParameterDefinitionWidget
virtual QgsProcessingAbstractParameterDefinitionWidget * createParameterDefinitionWidget(QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition=nullptr, const QgsProcessingAlgorithm *algorithm=nullptr)
Creates a new parameter definition widget allowing for configuration of an instance of the parameter ...
Definition: qgsprocessingwidgetwrapper.cpp:380
qgsprocessingmodelchildparametersource.h
QgsCheckableComboBox
QComboBox subclass which allows selecting multiple items.
Definition: qgscheckablecombobox.h:124
QgsProcessingParameterWidgetFactoryInterface::compatibleParameterTypes
virtual QStringList compatibleParameterTypes() const =0
Returns a list of compatible Processing parameter types for inputs for this parameter.
QgsProcessingParameterEnum
An enum based parameter for processing algorithms, allowing for selection from predefined values.
Definition: qgsprocessingparameters.h:2540
QgsFieldExpressionWidget
The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions It contains ...
Definition: qgsfieldexpressionwidget.h:46
QgsFileWidget
The QgsFileWidget class creates a widget for selecting a file or a folder.
Definition: qgsfilewidget.h:38
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QgsProcessingParameterField
A vector layer or feature source field parameter for processing algorithms.
Definition: qgsprocessingparameters.h:2940
QgsProcessingContextGenerator
An interface for objects which can create Processing contexts.
Definition: qgsprocessingwidgetwrapper.h:52
QgsAbstractProcessingParameterWidgetWrapper::postInitialize
virtual void postInitialize(const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers)
Called after all wrappers have been created within a particular dialog or context,...
Definition: qgsprocessingwidgetwrapper.cpp:252