QGIS API Documentation  3.21.0-Master (909859188c)
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"
27 #include "processing/models/qgsprocessingmodelchildparametersource.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;
102  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
159  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
217  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
309  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
540  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
599  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
655  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
713  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
839  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
935  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1055  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1113  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1167  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1225  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1287  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1389  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1456  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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;
1765  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
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 
1784  private:
1785 
1786  QPointer< QgsProcessingMapLayerComboBox > mComboBox;
1787  int mBlockSignals = 0;
1788 
1789  friend class TestProcessingGui;
1790 };
1791 
1792 
1793 class GUI_EXPORT QgsProcessingRasterLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1794 {
1795  Q_OBJECT
1796 
1797  public:
1798 
1799  QgsProcessingRasterLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1800  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1801 
1802  // QgsProcessingParameterWidgetFactoryInterface
1803  QString parameterType() const override;
1805  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1806  QgsProcessingContext &context,
1807  const QgsProcessingParameterWidgetContext &widgetContext,
1808  const QgsProcessingParameterDefinition *definition = nullptr,
1809  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1810 
1811  protected:
1812  QStringList compatibleParameterTypes() const override;
1813 
1814  QStringList compatibleOutputTypes() const override;
1815 
1816  QString modelerExpressionFormatString() const override;
1817 
1818 };
1819 
1820 
1821 class GUI_EXPORT QgsProcessingVectorLayerParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1822 {
1823  Q_OBJECT
1824  public:
1825 
1826  QgsProcessingVectorLayerParameterDefinitionWidget( QgsProcessingContext &context,
1827  const QgsProcessingParameterWidgetContext &widgetContext,
1828  const QgsProcessingParameterDefinition *definition = nullptr,
1829  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1830  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1831 
1832  private:
1833 
1834  QgsCheckableComboBox *mGeometryTypeComboBox = nullptr;
1835 };
1836 
1837 class GUI_EXPORT QgsProcessingVectorLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1838 {
1839  Q_OBJECT
1840 
1841  public:
1842 
1843  QgsProcessingVectorLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1844  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1845 
1846  // QgsProcessingParameterWidgetFactoryInterface
1847  QString parameterType() const override;
1849  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1850  QgsProcessingContext &context,
1851  const QgsProcessingParameterWidgetContext &widgetContext,
1852  const QgsProcessingParameterDefinition *definition = nullptr,
1853  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1854 
1855  protected:
1856  QStringList compatibleParameterTypes() const override;
1857 
1858  QStringList compatibleOutputTypes() const override;
1859 
1860  QString modelerExpressionFormatString() const override;
1861  QList< int > compatibleDataTypes( const QgsProcessingParameterDefinition *parameter ) const override;
1862 };
1863 
1864 
1865 class GUI_EXPORT QgsProcessingFeatureSourceParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1866 {
1867  Q_OBJECT
1868  public:
1869 
1870  QgsProcessingFeatureSourceParameterDefinitionWidget( QgsProcessingContext &context,
1871  const QgsProcessingParameterWidgetContext &widgetContext,
1872  const QgsProcessingParameterDefinition *definition = nullptr,
1873  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1874  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1875 
1876  private:
1877 
1878  QgsCheckableComboBox *mGeometryTypeComboBox = nullptr;
1879 };
1880 
1881 class GUI_EXPORT QgsProcessingFeatureSourceWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1882 {
1883  Q_OBJECT
1884 
1885  public:
1886 
1887  QgsProcessingFeatureSourceWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1888  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1889 
1890  // QgsProcessingParameterWidgetFactoryInterface
1891  QString parameterType() const override;
1893  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1894  QgsProcessingContext &context,
1895  const QgsProcessingParameterWidgetContext &widgetContext,
1896  const QgsProcessingParameterDefinition *definition = nullptr,
1897  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1898 
1899  protected:
1900  QStringList compatibleParameterTypes() const override;
1901 
1902  QStringList compatibleOutputTypes() const override;
1903 
1904  QString modelerExpressionFormatString() const override;
1905  QList< int > compatibleDataTypes( const QgsProcessingParameterDefinition *parameter ) const override;
1906 };
1907 
1908 
1909 class GUI_EXPORT QgsProcessingMeshLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
1910 {
1911  Q_OBJECT
1912 
1913  public:
1914 
1915  QgsProcessingMeshLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
1916  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
1917 
1918  // QgsProcessingParameterWidgetFactoryInterface
1919  QString parameterType() const override;
1921  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
1922  QgsProcessingContext &context,
1923  const QgsProcessingParameterWidgetContext &widgetContext,
1924  const QgsProcessingParameterDefinition *definition = nullptr,
1925  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
1926 
1927  protected:
1928  QStringList compatibleParameterTypes() const override;
1929 
1930  QStringList compatibleOutputTypes() const override;
1931 
1932  QString modelerExpressionFormatString() const override;
1933 
1934 };
1935 
1936 
1937 class GUI_EXPORT QgsProcessingRasterBandPanelWidget : public QWidget
1938 {
1939  Q_OBJECT
1940 
1941  public:
1942 
1943  QgsProcessingRasterBandPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterBand *param = nullptr );
1944 
1945  void setBands( const QList< int > &bands );
1946  void setBandNames( const QHash<int, QString > &names );
1947  QList< int > bands() const { return mBands; }
1948 
1949  QVariant value() const { return mValue; }
1950  void setValue( const QVariant &value );
1951 
1952  signals:
1953 
1954  void changed();
1955 
1956  private slots:
1957 
1958  void showDialog();
1959 
1960  private:
1961 
1962  void updateSummaryText();
1963 
1964  QList< int > mBands;
1965  QHash<int, QString > mBandNames;
1966 
1967  const QgsProcessingParameterBand *mParam = nullptr;
1968  QLineEdit *mLineEdit = nullptr;
1969  QToolButton *mToolButton = nullptr;
1970 
1971  QVariantList mValue;
1972 
1973  friend class TestProcessingGui;
1974 };
1975 
1976 class GUI_EXPORT QgsProcessingBandParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
1977 {
1978  Q_OBJECT
1979  public:
1980 
1981  QgsProcessingBandParameterDefinitionWidget( QgsProcessingContext &context,
1982  const QgsProcessingParameterWidgetContext &widgetContext,
1983  const QgsProcessingParameterDefinition *definition = nullptr,
1984  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1985  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
1986 
1987  private:
1988 
1989  QComboBox *mParentLayerComboBox = nullptr;
1990  QLineEdit *mDefaultLineEdit = nullptr;
1991  QCheckBox *mAllowMultipleCheckBox = nullptr;
1992 };
1993 
1994 class GUI_EXPORT QgsProcessingBandWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
1995 {
1996  Q_OBJECT
1997 
1998  public:
1999 
2000  QgsProcessingBandWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2001  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2002 
2003  // QgsProcessingParameterWidgetFactoryInterface
2004  QString parameterType() const override;
2006  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
2007  QgsProcessingContext &context,
2008  const QgsProcessingParameterWidgetContext &widgetContext,
2009  const QgsProcessingParameterDefinition *definition = nullptr,
2010  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2011 
2012  // QgsProcessingParameterWidgetWrapper interface
2013  QWidget *createWidget() override SIP_FACTORY;
2014  void postInitialize( const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers ) override;
2015 
2016  public slots:
2017  void setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
2018 
2019  protected:
2020 
2021  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2022  QVariant widgetValue() const override;
2023 
2024  QStringList compatibleParameterTypes() const override;
2025 
2026  QStringList compatibleOutputTypes() const override;
2027  QString modelerExpressionFormatString() const override;
2028 
2029  private:
2030 
2031  QgsRasterBandComboBox *mComboBox = nullptr;
2032  QgsProcessingRasterBandPanelWidget *mPanel = nullptr;
2033  QLineEdit *mLineEdit = nullptr;
2034 
2035  std::unique_ptr< QgsRasterLayer > mParentLayer;
2036 
2037  friend class TestProcessingGui;
2038 };
2039 
2040 
2041 
2042 class GUI_EXPORT QgsProcessingMultipleLayerPanelWidget : public QWidget
2043 {
2044  Q_OBJECT
2045 
2046  public:
2047 
2048  QgsProcessingMultipleLayerPanelWidget( QWidget *parent = nullptr, const QgsProcessingParameterMultipleLayers *param = nullptr );
2049 
2050  QVariant value() const { return mValue; }
2051  void setValue( const QVariant &value );
2052 
2053  void setProject( QgsProject *project );
2054  void setModel( QgsProcessingModelAlgorithm *model, const QString &modelChildAlgorithmID );
2055 
2056  signals:
2057 
2058  void changed();
2059 
2060  private slots:
2061 
2062  void showDialog();
2063 
2064  private:
2065 
2066  void updateSummaryText();
2067 
2068  const QgsProcessingParameterMultipleLayers *mParam = nullptr;
2069  QLineEdit *mLineEdit = nullptr;
2070  QToolButton *mToolButton = nullptr;
2071 
2072  QVariantList mValue;
2073  QList< QgsProcessingModelChildParameterSource > mModelSources;
2074  QgsProcessingModelAlgorithm *mModel = nullptr;
2075 
2076  QgsProject *mProject = nullptr;
2077 
2078  friend class TestProcessingGui;
2079 };
2080 
2081 class GUI_EXPORT QgsProcessingMultipleLayerParameterDefinitionWidget : public QgsProcessingAbstractParameterDefinitionWidget
2082 {
2083  Q_OBJECT
2084  public:
2085 
2086  QgsProcessingMultipleLayerParameterDefinitionWidget( QgsProcessingContext &context,
2087  const QgsProcessingParameterWidgetContext &widgetContext,
2088  const QgsProcessingParameterDefinition *definition = nullptr,
2089  const QgsProcessingAlgorithm *algorithm = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr );
2090  QgsProcessingParameterDefinition *createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const override;
2091 
2092  private:
2093 
2094  QComboBox *mLayerTypeComboBox = nullptr;
2095 };
2096 
2097 class GUI_EXPORT QgsProcessingMultipleLayerWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2098 {
2099  Q_OBJECT
2100 
2101  public:
2102 
2103  QgsProcessingMultipleLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2104  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2105 
2106  // QgsProcessingParameterWidgetFactoryInterface
2107  QString parameterType() const override;
2109  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
2110  QgsProcessingContext &context,
2111  const QgsProcessingParameterWidgetContext &widgetContext,
2112  const QgsProcessingParameterDefinition *definition = nullptr,
2113  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2114 
2115  // QgsProcessingParameterWidgetWrapper interface
2116  QWidget *createWidget() override SIP_FACTORY;
2117  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
2118 
2119  protected:
2120 
2121  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2122  QVariant widgetValue() const override;
2123 
2124  QStringList compatibleParameterTypes() const override;
2125 
2126  QStringList compatibleOutputTypes() const override;
2127  QString modelerExpressionFormatString() const override;
2128 
2129  private:
2130 
2131  QgsProcessingMultipleLayerPanelWidget *mPanel = nullptr;
2132 
2133  friend class TestProcessingGui;
2134 };
2135 
2136 
2137 
2138 class GUI_EXPORT QgsProcessingOutputWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2139 {
2140  Q_OBJECT
2141 
2142  public:
2143 
2144  QgsProcessingOutputWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2145  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2146 
2147  // QgsProcessingParameterWidgetWrapper interface
2148  QWidget *createWidget() override SIP_FACTORY;
2149  protected:
2150 
2151  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2152  QVariant widgetValue() const override;
2153  QVariantMap customProperties() const override;
2154 
2155  QStringList compatibleParameterTypes() const override;
2156 
2157  QStringList compatibleOutputTypes() const override;
2158 
2159  private:
2160 
2161  QgsProcessingLayerOutputDestinationWidget *mOutputWidget = nullptr;
2162  int mBlockSignals = 0;
2163 
2164  friend class TestProcessingGui;
2165 };
2166 
2167 
2168 class GUI_EXPORT QgsProcessingFeatureSinkWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2169 {
2170  Q_OBJECT
2171 
2172  public:
2173 
2174  QgsProcessingFeatureSinkWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2175  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2176 
2177  // QgsProcessingParameterWidgetFactoryInterface
2178  QString parameterType() const override;
2180 
2181  protected:
2182  QString modelerExpressionFormatString() const override;
2183 
2184  private:
2185  QgsProcessingContext mContext;
2186 
2187 };
2188 
2189 class GUI_EXPORT QgsProcessingVectorDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2190 {
2191  Q_OBJECT
2192 
2193  public:
2194 
2195  QgsProcessingVectorDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2196  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2197 
2198  // QgsProcessingParameterWidgetFactoryInterface
2199  QString parameterType() const override;
2201 
2202  protected:
2203  QString modelerExpressionFormatString() const override;
2204 
2205 };
2206 
2207 class GUI_EXPORT QgsProcessingRasterDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2208 {
2209  Q_OBJECT
2210 
2211  public:
2212 
2213  QgsProcessingRasterDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2214  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2215 
2216  // QgsProcessingParameterWidgetFactoryInterface
2217  QString parameterType() const override;
2219 
2220  protected:
2221  QString modelerExpressionFormatString() const override;
2222 
2223 };
2224 
2225 class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2226 {
2227  Q_OBJECT
2228 
2229  public:
2230 
2231  QgsProcessingFileDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2232  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2233 
2234  // QgsProcessingParameterWidgetFactoryInterface
2235  QString parameterType() const override;
2237 
2238  protected:
2239  QString modelerExpressionFormatString() const override;
2240 
2241 };
2242 
2243 class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper : public QgsProcessingOutputWidgetWrapper
2244 {
2245  Q_OBJECT
2246 
2247  public:
2248 
2249  QgsProcessingFolderDestinationWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2250  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2251 
2252  // QgsProcessingParameterWidgetFactoryInterface
2253  QString parameterType() const override;
2255 
2256  protected:
2257  QString modelerExpressionFormatString() const override;
2258 
2259 };
2260 
2261 class GUI_EXPORT QgsProcessingPointCloudLayerWidgetWrapper : public QgsProcessingMapLayerWidgetWrapper
2262 {
2263  Q_OBJECT
2264 
2265  public:
2266 
2267  QgsProcessingPointCloudLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2268  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2269 
2270  // QgsProcessingParameterWidgetFactoryInterface
2271  QString parameterType() const override;
2273  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
2274  QgsProcessingContext &context,
2275  const QgsProcessingParameterWidgetContext &widgetContext,
2276  const QgsProcessingParameterDefinition *definition = nullptr,
2277  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2278 
2279  protected:
2280  QStringList compatibleParameterTypes() const override;
2281 
2282  QStringList compatibleOutputTypes() const override;
2283 
2284  QString modelerExpressionFormatString() const override;
2285 
2286 };
2287 
2288 
2289 class GUI_EXPORT QgsProcessingAnnotationLayerWidgetWrapper : public QgsAbstractProcessingParameterWidgetWrapper, public QgsProcessingParameterWidgetFactoryInterface
2290 {
2291  Q_OBJECT
2292 
2293  public:
2294 
2295  QgsProcessingAnnotationLayerWidgetWrapper( const QgsProcessingParameterDefinition *parameter = nullptr,
2296  QgsProcessingGui::WidgetType type = QgsProcessingGui::Standard, QWidget *parent = nullptr );
2297 
2298  // QgsProcessingParameterWidgetFactoryInterface
2299  QString parameterType() const override;
2301  QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
2302  QgsProcessingContext &context,
2303  const QgsProcessingParameterWidgetContext &widgetContext,
2304  const QgsProcessingParameterDefinition *definition = nullptr,
2305  const QgsProcessingAlgorithm *algorithm = nullptr ) override;
2306  void setWidgetContext( const QgsProcessingParameterWidgetContext &context ) override;
2307 
2308  QWidget *createWidget() override SIP_FACTORY;
2309  protected:
2310 
2311  void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
2312  QVariant widgetValue() const override;
2313 
2314  QStringList compatibleParameterTypes() const override;
2315 
2316  QStringList compatibleOutputTypes() const override;
2317 
2318  QString modelerExpressionFormatString() const override;
2319 
2320  private:
2321 
2322  QPointer< QgsMapLayerComboBox > mComboBox;
2323  int mBlockSignals = 0;
2324 
2325  friend class TestProcessingGui;
2326 };
2327 
2328 
2330 
2331 #endif // QGSPROCESSINGWIDGETWRAPPERIMPL_H
A widget wrapper for Processing parameter value widgets.
Selector widget for authentication configs.
QComboBox subclass which allows selecting multiple items.
A cross platform button subclass for selecting colors.
A widget for selecting the coordinate operation to use when transforming between a source and destina...
This class represents a coordinate reference system (CRS).
The QgsDatabaseSchemaComboBox class is a combo box which displays the list of schemas for a specific ...
The QgsDatabaseTableComboBox class is a combo box which displays the list of tables for a specific da...
The QgsDateEdit class is a QDateEdit widget with the capability of setting/reading null dates.
The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
A reusable widget that can be used to build a expression string.
The QgsExpressionLineEdit widget includes a line edit for entering expressions together with a button...
A widget for configuration of a map extent.
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions It contains ...
Container of fields for a vector layer.
Definition: qgsfields.h:45
The QgsFileWidget class creates a widget for selecting a file or a folder.
Definition: qgsfilewidget.h:39
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
The QgsLayoutComboBox class is a combo box which displays available layouts from a QgsLayoutManager.
The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:87
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
Abstract base class for all map tools.
Definition: qgsmaptool.h:66
A class to represent a 2D point.
Definition: qgspointxy.h:59
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Abstract base class for widgets which allow users to specify the properties of a Processing parameter...
virtual void setWidgetContext(const QgsProcessingParameterWidgetContext &context)
Sets the context in which the Processing definition widget is shown, e.g., the parent model algorithm...
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.
Abstract base class for processing algorithms.
An interface for objects which can create Processing contexts.
Contains information about the context in which a processing algorithm is executed.
WidgetType
Types of dialogs which Processing widgets can be created for.
@ Standard
Standard algorithm dialog.
A raster band parameter for Processing algorithms.
Base class for the definition of processing parameters.
An enum based parameter for processing algorithms, allowing for selection from predefined values.
A vector layer or feature source field parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
Contains settings which reflect the context in which a Processing parameter widget is shown,...
An interface for Processing widget wrapper factories.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:101
A widget for selecting a projection.
The QgsProviderConnectionComboBox class is a combo box which displays the list of connections registe...
A combobox widget which displays the bands present in a raster layer.
Represents a raster layer.
A combobox which lets the user select map scale from predefined list and highlights nearest to curren...
Class that shows snapping marker on map canvas for the current snapping match.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
Definition: qgsspinbox.h:43
The QgsTimeEdit class is a QTimeEdit widget with the capability of setting/reading null date/times.
Helper functions for various unit types.
Definition: qgsunittypes.h:39
Represents a vector layer which manages a vector based data sets.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
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
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_FACTORY
Definition: qgis_sip.h:76
const QgsCoordinateReferenceSystem & crs