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