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