34#include <QApplication>
35#include <QGraphicsSceneHoverEvent>
42#include <QSvgRenderer>
44#include "moc_qgsmodelcomponentgraphicitem.cpp"
46using namespace Qt::StringLiterals;
50QgsModelComponentGraphicItem::QgsModelComponentGraphicItem( QgsProcessingModelComponent *component, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
51 : QGraphicsObject( parent )
52 , mComponent( component )
55 setAcceptHoverEvents(
true );
56 setFlag( QGraphicsItem::ItemIsSelectable,
true );
57 setFlag( QGraphicsItem::ItemSendsGeometryChanges,
true );
58 setZValue( QgsModelGraphicsScene::ZValues::ModelComponent );
60 mFont.setPixelSize( 12 );
64 QPainter painter( &editPicture );
65 svg.render( &painter );
67 mEditButton =
new QgsModelDesignerFlatButtonGraphicItem(
this, editPicture, QPointF( 0, 0 ) );
68 connect( mEditButton, &QgsModelDesignerFlatButtonGraphicItem::clicked,
this, &QgsModelComponentGraphicItem::editComponent );
71 QPicture deletePicture;
72 painter.begin( &deletePicture );
73 svg2.render( &painter );
75 mDeleteButton =
new QgsModelDesignerFlatButtonGraphicItem(
this, deletePicture, QPointF( 0, 0 ) );
76 connect( mDeleteButton, &QgsModelDesignerFlatButtonGraphicItem::clicked,
this, &QgsModelComponentGraphicItem::deleteComponent );
78 updateButtonPositions();
81QgsModelComponentGraphicItem::Flags QgsModelComponentGraphicItem::flags()
const
83 return QgsModelComponentGraphicItem::Flags();
86QgsModelComponentGraphicItem::~QgsModelComponentGraphicItem() =
default;
88QgsProcessingModelComponent *QgsModelComponentGraphicItem::component()
90 return mComponent.get();
93const QgsProcessingModelComponent *QgsModelComponentGraphicItem::component()
const
95 return mComponent.get();
98QgsProcessingModelAlgorithm *QgsModelComponentGraphicItem::model()
103const QgsProcessingModelAlgorithm *QgsModelComponentGraphicItem::model()
const
108QgsModelGraphicsView *QgsModelComponentGraphicItem::view()
110 if ( scene()->views().isEmpty() )
113 return qobject_cast<QgsModelGraphicsView *>( scene()->views().first() );
116QFont QgsModelComponentGraphicItem::font()
const
121void QgsModelComponentGraphicItem::setFont(
const QFont &font )
127void QgsModelComponentGraphicItem::moveComponentBy( qreal dx, qreal dy )
129 setPos( mComponent->position().x() + dx, mComponent->position().y() + dy );
130 mComponent->setPosition( pos() );
132 emit aboutToChange( tr(
"Move %1" ).arg( mComponent->description() ) );
133 updateStoredComponentPosition( pos(), mComponent->size() );
136 emit sizePositionChanged();
137 emit updateArrowPaths();
140void QgsModelComponentGraphicItem::previewItemMove( qreal dx, qreal dy )
142 setPos( mComponent->position().x() + dx, mComponent->position().y() + dy );
143 emit updateArrowPaths();
146void QgsModelComponentGraphicItem::setItemRect( QRectF rect )
148 rect = rect.normalized();
150 if ( rect.width() < MIN_COMPONENT_WIDTH )
151 rect.setWidth( MIN_COMPONENT_WIDTH );
152 if ( rect.height() < MIN_COMPONENT_HEIGHT )
153 rect.setHeight( MIN_COMPONENT_HEIGHT );
155 setPos( rect.center() );
156 prepareGeometryChange();
158 emit aboutToChange( tr(
"Resize %1" ).arg( mComponent->description() ) );
160 mComponent->setPosition( pos() );
161 mComponent->setSize( rect.size() );
162 updateStoredComponentPosition( pos(), mComponent->size() );
164 updateButtonPositions();
167 emit updateArrowPaths();
168 emit sizePositionChanged();
171QRectF QgsModelComponentGraphicItem::previewItemRectChange( QRectF rect )
173 rect = rect.normalized();
175 if ( rect.width() < MIN_COMPONENT_WIDTH )
176 rect.setWidth( MIN_COMPONENT_WIDTH );
177 if ( rect.height() < MIN_COMPONENT_HEIGHT )
178 rect.setHeight( MIN_COMPONENT_HEIGHT );
180 setPos( rect.center() );
181 prepareGeometryChange();
183 mTempSize = rect.size();
185 updateButtonPositions();
186 emit updateArrowPaths();
191void QgsModelComponentGraphicItem::finalizePreviewedItemRectChange( QRectF )
193 mComponent->setPosition( pos() );
194 prepareGeometryChange();
195 mComponent->setSize( mTempSize );
196 mTempSize = QSizeF();
198 emit aboutToChange( tr(
"Resize %1" ).arg( mComponent->description() ) );
199 updateStoredComponentPosition( pos(), mComponent->size() );
201 updateButtonPositions();
205 emit sizePositionChanged();
206 emit updateArrowPaths();
211 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
212 updateToolTip( mapFromScene( event->
modelPoint() ) );
217 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
218 updateToolTip( mapFromScene( event->
modelPoint() ) );
223 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
225 setToolTip( QString() );
230 emit repaintArrows();
237 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
241void QgsModelComponentGraphicItem::mouseDoubleClickEvent( QGraphicsSceneMouseEvent * )
243 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
247void QgsModelComponentGraphicItem::hoverEnterEvent( QGraphicsSceneHoverEvent *event )
249 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
250 updateToolTip( event->pos() );
253void QgsModelComponentGraphicItem::hoverMoveEvent( QGraphicsSceneHoverEvent *event )
255 if ( view() && view()->tool() && view()->tool()->allowItemInteraction() )
256 updateToolTip( event->pos() );
259void QgsModelComponentGraphicItem::hoverLeaveEvent( QGraphicsSceneHoverEvent * )
261 modelHoverLeaveEvent(
nullptr );
264QVariant QgsModelComponentGraphicItem::itemChange( QGraphicsItem::GraphicsItemChange change,
const QVariant &value )
268 case QGraphicsItem::ItemSelectedChange:
270 emit repaintArrows();
274 case QGraphicsItem::ItemSceneChange:
279 if ( linkPointCount( Qt::TopEdge ) )
281 mExpandTopButton =
new QgsModelDesignerFoldButtonGraphicItem(
this, mComponent->linksCollapsed( Qt::TopEdge ), QPointF( 0, 0 ) );
282 connect( mExpandTopButton, &QgsModelDesignerFoldButtonGraphicItem::folded,
this, [
this](
bool folded ) { fold( Qt::TopEdge, folded ); } );
284 for (
int idx = 0; idx < linkPointCount( Qt::TopEdge ); ++idx )
286 mInSockets.append(
new QgsModelDesignerSocketGraphicItem(
this, mComponent.get(), idx, QPointF( 0, 0 ), Qt::TopEdge ) );
289 if ( linkPointCount( Qt::BottomEdge ) )
291 mExpandBottomButton =
new QgsModelDesignerFoldButtonGraphicItem(
this, mComponent->linksCollapsed( Qt::BottomEdge ), QPointF( 0, 0 ) );
292 connect( mExpandBottomButton, &QgsModelDesignerFoldButtonGraphicItem::folded,
this, [
this](
bool folded ) { fold( Qt::BottomEdge, folded ); } );
294 for (
int idx = 0; idx < linkPointCount( Qt::BottomEdge ); ++idx )
296 mOutSockets.append(
new QgsModelDesignerSocketGraphicItem(
this, mComponent.get(), idx, QPointF( 0, 0 ), Qt::BottomEdge ) );
300 updateButtonPositions();
309 return QGraphicsObject::itemChange( change, value );
312QRectF QgsModelComponentGraphicItem::boundingRect()
const
314 const QFontMetricsF fm( mFont );
315 const int linksAbove = linkPointCount( Qt::TopEdge );
316 const int linksBelow = linkPointCount( Qt::BottomEdge );
318 const double hUp = linksAbove == 0 ? 0 : fm.height() * 1.2 * ( ( mComponent->linksCollapsed( Qt::TopEdge ) ? 0 : linksAbove ) + 2 );
319 const double hDown = linksBelow == 0 ? 0 : fm.height() * 1.2 * ( ( mComponent->linksCollapsed( Qt::BottomEdge ) ? 0 : linksBelow ) + 2 );
320 return QRectF( -( itemSize().width() ) / 2 - RECT_PEN_SIZE, -( itemSize().height() ) / 2 - hUp - RECT_PEN_SIZE, itemSize().width() + 2 * RECT_PEN_SIZE, itemSize().height() + hDown + hUp + 2 * RECT_PEN_SIZE );
323bool QgsModelComponentGraphicItem::contains(
const QPointF &point )
const
325 const QRectF paintingBounds = boundingRect();
326 if ( point.x() < paintingBounds.left() + RECT_PEN_SIZE )
328 if ( point.x() > paintingBounds.right() - RECT_PEN_SIZE )
330 if ( point.y() < paintingBounds.top() + RECT_PEN_SIZE )
332 if ( point.y() > paintingBounds.bottom() - RECT_PEN_SIZE )
338void QgsModelComponentGraphicItem::paint( QPainter *painter,
const QStyleOptionGraphicsItem *, QWidget * )
340 const QRectF rect = itemRect();
344 if ( mComponent->color().isValid() )
346 color = mComponent->color();
350 color = color.darker( 110 );
353 color = color.darker( 105 );
359 stroke = color.darker( 110 );
360 foreColor = color.lightness() > 150 ? QColor( 0, 0, 0 ) : QColor( 255, 255, 255 );
364 color = fillColor( state() );
365 stroke = strokeColor( state() );
366 foreColor = textColor( state() );
369 QPen strokePen = QPen( stroke, 0 );
370 strokePen.setStyle( strokeStyle( state() ) );
371 painter->setPen( strokePen );
372 painter->setBrush( QBrush( color, Qt::SolidPattern ) );
373 painter->drawRect( rect );
374 painter->setFont( font() );
375 painter->setPen( QPen( foreColor ) );
379 const QSizeF componentSize = itemSize();
381 const QFontMetricsF fm( font() );
382 double h = fm.ascent();
383 QPointF pt( -componentSize.width() / 2 + 25, componentSize.height() / 2.0 - h + 1 );
385 if ( iconPicture().isNull() && iconPixmap().isNull() )
387 const QRectF labelRect = QRectF( rect.left() + TEXT_MARGIN, rect.top() + TEXT_MARGIN, rect.width() - 2 * TEXT_MARGIN - mButtonSize.width() - BUTTON_MARGIN, rect.height() - 2 * TEXT_MARGIN );
389 painter->drawText( labelRect, Qt::TextWordWrap | titleAlignment(), text );
393 const QRectF labelRect = QRectF( rect.left() + 21 + TEXT_MARGIN, rect.top() + TEXT_MARGIN, rect.width() - 2 * TEXT_MARGIN - mButtonSize.width() - BUTTON_MARGIN - 21, rect.height() - 2 * TEXT_MARGIN );
395 painter->drawText( labelRect, Qt::TextWordWrap | Qt::AlignVCenter, text );
398 painter->setPen( QPen( QApplication::palette().color( QPalette::Text ) ) );
400 if ( linkPointCount( Qt::TopEdge ) )
402 h = -( fm.height() * 1.2 );
403 h = h - componentSize.height() / 2.0 + 5;
404 pt = QPointF( -componentSize.width() / 2 + 25, h );
405 painter->drawText( pt, QObject::tr(
"In" ) );
407 if ( !mComponent->linksCollapsed( Qt::TopEdge ) )
409 for (
int idx = 0; idx < linkPointCount( Qt::TopEdge ); ++idx )
411 text = linkPointText( Qt::TopEdge, idx );
412 h = -( fm.height() * 1.2 ) * ( i + 1 );
413 h = h - componentSize.height() / 2.0 + 5;
414 pt = QPointF( -componentSize.width() / 2 + 33, h );
415 painter->drawText( pt, text );
420 if ( linkPointCount( Qt::BottomEdge ) )
422 h = fm.height() * 1.1;
423 h = h + componentSize.height() / 2.0;
424 pt = QPointF( -componentSize.width() / 2 + 25, h );
425 painter->drawText( pt, QObject::tr(
"Out" ) );
426 if ( !mComponent->linksCollapsed( Qt::BottomEdge ) )
428 for (
int idx = 0; idx < linkPointCount( Qt::BottomEdge ); ++idx )
430 text = linkPointText( Qt::BottomEdge, idx );
431 h = fm.height() * 1.2 * ( idx + 2 );
432 h = h + componentSize.height() / 2.0;
433 pt = QPointF( -componentSize.width() / 2 + 33, h );
434 painter->drawText( pt, text );
439 const QPixmap px = iconPixmap();
442 painter->drawPixmap( QPointF( -( componentSize.width() / 2.0 ) + 3, -8 ), px );
446 const QPicture pic = iconPicture();
449 painter->drawPicture( QPointF( -( componentSize.width() / 2.0 ) + 3, -8 ), pic );
454QRectF QgsModelComponentGraphicItem::itemRect(
bool storedRect )
const
458 return QRectF( mComponent->position().x() - ( mComponent->size().width() ) / 2.0, mComponent->position().y() - ( mComponent->size().height() ) / 2.0, mComponent->size().width(), mComponent->size().height() );
461 return QRectF( -( itemSize().width() ) / 2.0, -( itemSize().height() ) / 2.0, itemSize().width(), itemSize().height() );
464QString QgsModelComponentGraphicItem::truncatedTextForItem(
const QString &text )
const
466 const QFontMetricsF fm( mFont );
467 double width = fm.boundingRect( text ).width();
468 if ( width < itemSize().width() - 25 - mButtonSize.width() )
472 t = t.left( t.length() - 3 ) + QChar( 0x2026 );
473 width = fm.boundingRect( t ).width();
474 while ( width > itemSize().width() - 25 - mButtonSize.width() )
476 if ( t.length() < 5 )
479 t = t.left( t.length() - 4 ) + QChar( 0x2026 );
480 width = fm.boundingRect( t ).width();
485Qt::PenStyle QgsModelComponentGraphicItem::strokeStyle( QgsModelComponentGraphicItem::State )
const
487 return Qt::SolidLine;
490Qt::Alignment QgsModelComponentGraphicItem::titleAlignment()
const
492 return Qt::AlignLeft;
495QPicture QgsModelComponentGraphicItem::iconPicture()
const
500QPixmap QgsModelComponentGraphicItem::iconPixmap()
const
506void QgsModelComponentGraphicItem::updateButtonPositions()
508 mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) );
509 mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) );
511 if ( mExpandBottomButton )
513 const QPointF pt = linkPoint( Qt::BottomEdge, -1,
false );
514 mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) );
516 bool collapsed = mComponent->linksCollapsed( Qt::BottomEdge );
517 for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) )
519 const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(),
false );
520 socket->setPosition( pt );
521 socket->setVisible( !collapsed );
526 if ( mExpandTopButton )
528 const QPointF pt = linkPoint( Qt::TopEdge, -1,
true );
529 mExpandTopButton->setPosition( QPointF( 0, pt.y() ) );
531 bool collapsed = mComponent->linksCollapsed( Qt::TopEdge );
532 for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) )
534 const QPointF pt = linkPoint( Qt::TopEdge, socket->index(),
true );
535 socket->setPosition( pt );
536 socket->setVisible( !collapsed );
542QSizeF QgsModelComponentGraphicItem::itemSize()
const
544 return !mTempSize.isValid() ? mComponent->size() : mTempSize;
547void QgsModelComponentGraphicItem::updateToolTip(
const QPointF &pos )
549 const bool prevHoverStatus = mIsHovering;
550 if ( itemRect().contains( pos ) )
552 setToolTip( mLabel );
557 setToolTip( QString() );
560 if ( mIsHovering != prevHoverStatus )
563 emit repaintArrows();
567void QgsModelComponentGraphicItem::fold( Qt::Edge edge,
bool folded )
569 emit aboutToChange( !folded ? tr(
"Expand Item" ) : tr(
"Collapse Item" ) );
570 mComponent->setLinksCollapsed( edge, folded );
574 if ( QgsProcessingModelChildAlgorithm *child =
dynamic_cast<QgsProcessingModelChildAlgorithm *
>( mComponent.get() ) )
576 mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded );
578 else if ( QgsProcessingModelParameter *param =
dynamic_cast<QgsProcessingModelParameter *
>( mComponent.get() ) )
580 mModel->parameterComponent( param->parameterName() ).setLinksCollapsed( edge, folded );
582 else if ( QgsProcessingModelOutput *output =
dynamic_cast<QgsProcessingModelOutput *
>( mComponent.get() ) )
584 mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded );
587 updateButtonPositions();
588 prepareGeometryChange();
589 emit updateArrowPaths();
594QString QgsModelComponentGraphicItem::label()
const
599void QgsModelComponentGraphicItem::setLabel(
const QString &label )
605QgsModelComponentGraphicItem::State QgsModelComponentGraphicItem::state()
const
609 else if ( mIsHovering )
615int QgsModelComponentGraphicItem::linkPointCount( Qt::Edge )
const
620QString QgsModelComponentGraphicItem::linkPointText( Qt::Edge,
int )
const
625QPointF QgsModelComponentGraphicItem::linkPoint( Qt::Edge edge,
int index,
bool incoming )
const
631 if ( linkPointCount( Qt::BottomEdge ) )
634 if ( mComponent->linksCollapsed( Qt::BottomEdge ) )
638 const int pointIndex = !mComponent->linksCollapsed( Qt::BottomEdge ) ? index : -1;
639 const QString text = truncatedTextForItem( linkPointText( Qt::BottomEdge, index ) );
640 const QFontMetricsF fm( mFont );
641 const double w = fm.boundingRect( text ).width();
642 const double h = fm.height() * 1.2 * ( pointIndex + 1 ) + fm.height() / 2.0;
643 const double y = h + itemSize().height() / 2.0 + 6.4;
644 const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 10 ) : 10.4;
645 return QPointF( incoming ? -itemSize().width() / 2 + offsetX : x, y );
652 if ( linkPointCount( Qt::TopEdge ) )
655 int paramIndex = index;
656 if ( mComponent->linksCollapsed( Qt::TopEdge ) )
661 const QFontMetricsF fm( mFont );
662 const QString text = truncatedTextForItem( linkPointText( Qt::TopEdge, index ) );
663 const double w = fm.boundingRect( text ).width();
664 double h = -( fm.height() * 1.2 ) * ( paramIndex + 2 ) - fm.height() / 2.0 + 8;
665 h = h - itemSize().height() / 2.0;
666 return QPointF( incoming ? -itemSize().width() / 2 + offsetX : ( !mComponent->linksCollapsed( Qt::TopEdge ) ? ( -itemSize().width() / 2 + 33 + w + 5 ) : 10 ), h );
678QPointF QgsModelComponentGraphicItem::calculateAutomaticLinkPoint( QgsModelComponentGraphicItem *other, Qt::Edge &edge )
const
681 const QgsRectangle otherRect( other->itemRect().translated( other->pos() ) );
683 const QPointF leftPoint = pos() + QPointF( -itemSize().width() / 2.0, 0 );
684 const double distLeft = otherRect.distance(
QgsPointXY( leftPoint ) );
686 const QPointF rightPoint = pos() + QPointF( itemSize().width() / 2.0, 0 );
687 const double distRight = otherRect.distance(
QgsPointXY( rightPoint ) );
689 const QPointF topPoint = pos() + QPointF( 0, -itemSize().height() / 2.0 );
690 const double distTop = otherRect.distance(
QgsPointXY( topPoint ) );
692 const QPointF bottomPoint = pos() + QPointF( 0, itemSize().height() / 2.0 );
693 const double distBottom = otherRect.distance(
QgsPointXY( bottomPoint ) );
695 if ( distLeft <= distRight && distLeft <= distTop && distLeft <= distBottom )
700 else if ( distRight <= distTop && distRight <= distBottom )
702 edge = Qt::RightEdge;
705 else if ( distBottom <= distTop )
707 edge = Qt::BottomEdge;
717QPointF QgsModelComponentGraphicItem::calculateAutomaticLinkPoint(
const QPointF &point, Qt::Edge &edge )
const
721 const QPointF leftPoint = pos() + QPointF( -itemSize().width() / 2.0, 0 );
722 const double distLeft = otherPt.distance(
QgsPointXY( leftPoint ) );
724 const QPointF rightPoint = pos() + QPointF( itemSize().width() / 2.0, 0 );
725 const double distRight = otherPt.distance(
QgsPointXY( rightPoint ) );
727 const QPointF topPoint = pos() + QPointF( 0, -itemSize().height() / 2.0 );
728 const double distTop = otherPt.distance(
QgsPointXY( topPoint ) );
730 const QPointF bottomPoint = pos() + QPointF( 0, itemSize().height() / 2.0 );
731 const double distBottom = otherPt.distance(
QgsPointXY( bottomPoint ) );
733 if ( distLeft <= distRight && distLeft <= distTop && distLeft <= distBottom )
738 else if ( distRight <= distTop && distRight <= distBottom )
740 edge = Qt::RightEdge;
743 else if ( distBottom <= distTop )
745 edge = Qt::BottomEdge;
755QgsModelDesignerSocketGraphicItem *QgsModelComponentGraphicItem::outSocketAt(
int index )
const
757 if ( index < 0 || index >= mOutSockets.size() )
761 return mOutSockets.at( index );
764QgsModelParameterGraphicItem::QgsModelParameterGraphicItem( QgsProcessingModelParameter *parameter, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
765 : QgsModelComponentGraphicItem( parameter, model, parent )
768 QPainter painter( &mPicture );
769 svg.render( &painter );
773 setLabel( parameterDefinition->description() );
775 setLabel( QObject::tr(
"Error (%1)" ).arg( parameter->parameterName() ) );
778void QgsModelParameterGraphicItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
780 QMenu *popupmenu =
new QMenu( event->widget() );
781 QAction *removeAction = popupmenu->addAction( QObject::tr(
"Remove" ) );
782 connect( removeAction, &QAction::triggered,
this, &QgsModelParameterGraphicItem::deleteComponent );
783 QAction *editAction = popupmenu->addAction( QObject::tr(
"Edit…" ) );
784 connect( editAction, &QAction::triggered,
this, &QgsModelParameterGraphicItem::editComponent );
785 QAction *editCommentAction = popupmenu->addAction( component()->comment()->description().isEmpty() ? QObject::tr(
"Add Comment…" ) : QObject::tr(
"Edit Comment…" ) );
786 connect( editCommentAction, &QAction::triggered,
this, &QgsModelParameterGraphicItem::editComment );
788 popupmenu->exec( event->screenPos() );
791QColor QgsModelParameterGraphicItem::fillColor( QgsModelComponentGraphicItem::State state )
const
793 QColor
c( 238, 242, 131 );
809QColor QgsModelParameterGraphicItem::strokeColor( QgsModelComponentGraphicItem::State state )
const
814 return QColor( 116, 113, 68 );
817 return QColor( 234, 226, 118 );
822QColor QgsModelParameterGraphicItem::textColor( QgsModelComponentGraphicItem::State )
const
827QPicture QgsModelParameterGraphicItem::iconPicture()
const
832int QgsModelParameterGraphicItem::linkPointCount( Qt::Edge edge )
const
847QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge,
int index )
const
854 if (
const QgsProcessingModelParameter *parameter =
dynamic_cast< const QgsProcessingModelParameter *
>( component() ) )
856 QString text = this->model()->parameterDefinition( parameter->parameterName() )->type();
861 const QVariant paramValue = paramDef->defaultValue();
863 if ( paramValue.isValid() )
865 text +=
": " + paramDef->userFriendlyString( paramValue );
868 return truncatedTextForItem( text );
874QColor QgsModelParameterGraphicItem::linkColor( Qt::Edge ,
int index )
const
878 return FALLBACK_COLOR;
881 if (
const QgsProcessingModelParameter *parameter =
dynamic_cast< const QgsProcessingModelParameter *
>( component() ) )
885 return parameterDefinition->modelColor();
889 return FALLBACK_COLOR;
892void QgsModelParameterGraphicItem::updateStoredComponentPosition(
const QPointF &pos,
const QSizeF &size )
894 if ( QgsProcessingModelParameter *param =
dynamic_cast<QgsProcessingModelParameter *
>( component() ) )
896 model()->parameterComponent( param->parameterName() ).setPosition( pos );
897 model()->parameterComponent( param->parameterName() ).setSize( size );
901bool QgsModelParameterGraphicItem::canDeleteComponent()
903 if (
const QgsProcessingModelParameter *param =
dynamic_cast<const QgsProcessingModelParameter *
>( component() ) )
905 if ( model()->childAlgorithmsDependOnParameter( param->parameterName() ) )
909 else if ( model()->otherParametersDependOnParameter( param->parameterName() ) )
921void QgsModelParameterGraphicItem::deleteComponent()
923 if (
const QgsProcessingModelParameter *param =
dynamic_cast<const QgsProcessingModelParameter *
>( component() ) )
925 if ( model()->childAlgorithmsDependOnParameter( param->parameterName() ) )
927 QMessageBox::warning(
nullptr, QObject::tr(
"Could not remove input" ), QObject::tr(
"Algorithms depend on the selected input.\n"
928 "Remove them before trying to remove it." ) );
930 else if ( model()->otherParametersDependOnParameter( param->parameterName() ) )
932 QMessageBox::warning(
nullptr, QObject::tr(
"Could not remove input" ), QObject::tr(
"Other inputs depend on the selected input.\n"
933 "Remove them before trying to remove it." ) );
937 emit aboutToChange( tr(
"Delete Input %1" ).arg( param->description() ) );
938 model()->removeModelParameter( param->parameterName() );
940 emit requestModelRepaint();
946QgsModelChildAlgorithmGraphicItem::QgsModelChildAlgorithmGraphicItem( QgsProcessingModelChildAlgorithm *child, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
947 : QgsModelComponentGraphicItem( child, model, parent )
949 if ( child->algorithm() && !child->algorithm()->svgIconPath().isEmpty() )
951 QSvgRenderer svg( child->algorithm()->svgIconPath() );
952 const QSizeF size = svg.defaultSize();
953 QPainter painter( &mPicture );
954 painter.scale( 16.0 / size.width(), 16.0 / size.width() );
955 svg.render( &painter );
958 else if ( child->algorithm() )
960 mPixmap = child->algorithm()->icon().pixmap( 15, 15 );
963 setLabel( child->description() );
966 mIsValid = model->validateChildAlgorithm( child->childId(), issues );
969void QgsModelChildAlgorithmGraphicItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
971 QMenu *popupmenu =
new QMenu( event->widget() );
975 QAction *runSelectedStepsAction = popupmenu->addAction( QObject::tr(
"Run Selected Steps…" ) );
977 connect( runSelectedStepsAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::runSelected );
980 QAction *runFromHereAction = popupmenu->addAction( QObject::tr(
"Run from Here…" ) );
982 connect( runFromHereAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::runFromHere );
984 popupmenu->addSeparator();
986 QAction *removeAction = popupmenu->addAction( QObject::tr(
"Remove" ) );
987 connect( removeAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::deleteComponent );
988 QAction *editAction = popupmenu->addAction( QObject::tr(
"Edit…" ) );
989 connect( editAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::editComponent );
990 QAction *editCommentAction = popupmenu->addAction( component()->comment()->description().isEmpty() ? QObject::tr(
"Add Comment…" ) : QObject::tr(
"Edit Comment…" ) );
991 connect( editCommentAction, &QAction::triggered,
this, &QgsModelParameterGraphicItem::editComment );
992 popupmenu->addSeparator();
994 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
996 if ( !child->isActive() )
998 QAction *activateAction = popupmenu->addAction( QObject::tr(
"Activate" ) );
999 connect( activateAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::activateAlgorithm );
1003 QAction *deactivateAction = popupmenu->addAction( QObject::tr(
"Deactivate" ) );
1004 connect( deactivateAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::deactivateAlgorithm );
1010 const QList<const QgsProcessingParameterDefinition *> outputParams =
algorithm->destinationParameterDefinitions();
1011 if ( !outputParams.isEmpty() )
1013 popupmenu->addSeparator();
1014 QAction *viewOutputLayersAction = popupmenu->addAction( QObject::tr(
"View Output Layers" ) );
1016 connect( viewOutputLayersAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::showPreviousResults );
1018 switch ( mResults.executionStatus() )
1022 viewOutputLayersAction->setEnabled(
false );
1031 QAction *viewLogAction = popupmenu->addAction( QObject::tr(
"View Log…" ) );
1032 connect( viewLogAction, &QAction::triggered,
this, &QgsModelChildAlgorithmGraphicItem::showLog );
1034 switch ( mResults.executionStatus() )
1037 viewLogAction->setEnabled(
false );
1046 popupmenu->exec( event->screenPos() );
1049QColor QgsModelChildAlgorithmGraphicItem::fillColor( QgsModelComponentGraphicItem::State state )
const
1054 c = QColor( 255, 255, 255 );
1056 c = QColor( 208, 0, 0 );
1061 c =
c.darker( 110 );
1064 c =
c.darker( 105 );
1073QColor QgsModelChildAlgorithmGraphicItem::strokeColor( QgsModelComponentGraphicItem::State state )
const
1078 return mIsValid ? QColor( 50, 50, 50 ) : QColor( 80, 0, 0 );
1081 return mIsValid ? Qt::gray : QColor( 134, 0, 0 );
1086QColor QgsModelChildAlgorithmGraphicItem::textColor( QgsModelComponentGraphicItem::State )
const
1088 return mIsValid ? ( qgis::down_cast<const QgsProcessingModelChildAlgorithm *>( component() )->isActive() ? Qt::black : Qt::gray ) : QColor( 255, 255, 255 );
1091QPixmap QgsModelChildAlgorithmGraphicItem::iconPixmap()
const
1096QPicture QgsModelChildAlgorithmGraphicItem::iconPicture()
const
1101int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge )
const
1103 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1105 if ( !child->algorithm() )
1110 case Qt::BottomEdge:
1111 return child->algorithm()->outputDefinitions().size();
1116 return param->flags() & Qgis::ProcessingParameterFlag::Hidden || param->isDestination();
1119 return params.size();
1130QColor QgsModelComponentGraphicItem::linkColor( Qt::Edge edge,
int index )
const
1132 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1134 if ( !child->algorithm() )
1136 return FALLBACK_COLOR;
1141 case Qt::BottomEdge:
1143 if ( index <= child->
algorithm()->outputDefinitions().size() - 1 )
1145 return child->algorithm()->outputDefinitions().at( index )->modelColor();
1147 return FALLBACK_COLOR;
1153 if ( index <= params.size() - 1 )
1155 return params.at( index )->modelColor();
1158 return FALLBACK_COLOR;
1167 return FALLBACK_COLOR;
1170QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge,
int index )
const
1175 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1177 if ( !child->algorithm() )
1182 case Qt::BottomEdge:
1184 if ( index >= child->algorithm()->outputDefinitions().length() )
1188 tr(
"Cannot link output for child: %1" ).arg( child->algorithm()->name() ),
1196 return truncatedTextForItem( title );
1203 return param->flags() & Qgis::ProcessingParameterFlag::Hidden || param->isDestination();
1207 if ( index >= params.length() )
1211 tr(
"Cannot link source for child: %1" ).arg( child->algorithm()->name() ),
1218 QString name = param->
name();
1220 QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name );
1221 QString parameterValueAsString;
1223 if ( !paramSources.empty() )
1225 QgsProcessingModelChildParameterSource firstParameterSource = paramSources[0];
1227 switch ( firstParameterSource.source() )
1230 parameterValueAsString = u
": %1"_s.arg(
1231 firstParameterSource.friendlyIdentifier(
const_cast<QgsProcessingModelAlgorithm *
>( model() ) )
1236 parameterValueAsString = u
": %1"_s.arg( firstParameterSource.expression() );
1240 parameterValueAsString = u
": %1"_s.arg( firstParameterSource.expressionText() );
1244 parameterValueAsString = u
": <%1>"_s.arg( firstParameterSource.friendlyIdentifier(
const_cast<QgsProcessingModelAlgorithm *
>( model() ) ) );
1249 const QString friendlyName = firstParameterSource.friendlyIdentifier(
const_cast<QgsProcessingModelAlgorithm *
>( model() ) );
1250 parameterValueAsString = friendlyName.isEmpty() ? u
":"_s : u
": <%1>"_s.arg( friendlyName );
1255 const QVariant paramValue = paramSources[0].staticValue();
1258 title += parameterValueAsString;
1261 return truncatedTextForItem( title );
1272void QgsModelChildAlgorithmGraphicItem::updateStoredComponentPosition(
const QPointF &pos,
const QSizeF &size )
1274 if ( QgsProcessingModelChildAlgorithm *child =
dynamic_cast<QgsProcessingModelChildAlgorithm *
>( component() ) )
1276 model()->childAlgorithm( child->childId() ).setPosition( pos );
1277 model()->childAlgorithm( child->childId() ).setSize( size );
1281bool QgsModelChildAlgorithmGraphicItem::canDeleteComponent()
1283 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1285 return model()->dependentChildAlgorithms( child->childId() ).empty();
1292 if ( mResults == results )
1297 emit updateArrowPaths();
1300void QgsModelChildAlgorithmGraphicItem::deleteComponent()
1302 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1304 emit aboutToChange( tr(
"Remove %1" ).arg( child->algorithm() ? child->algorithm()->displayName() : tr(
"Algorithm" ) ) );
1305 if ( !model()->removeChildAlgorithm( child->childId() ) )
1307 QMessageBox::warning(
nullptr, QObject::tr(
"Could not remove algorithm" ), QObject::tr(
"Other algorithms depend on the selected one.\n"
1308 "Remove them before trying to remove it." ) );
1313 emit requestModelRepaint();
1318void QgsModelChildAlgorithmGraphicItem::deactivateAlgorithm()
1320 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1322 model()->deactivateChildAlgorithm( child->childId() );
1323 emit requestModelRepaint();
1327void QgsModelChildAlgorithmGraphicItem::activateAlgorithm()
1329 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( component() ) )
1331 if ( model()->activateChildAlgorithm( child->childId() ) )
1333 emit requestModelRepaint();
1337 QMessageBox::warning(
nullptr, QObject::tr(
"Could not activate algorithm" ), QObject::tr(
"The selected algorithm depends on other currently non-active algorithms.\n"
1338 "Activate them them before trying to activate it.." ) );
1344QgsModelOutputGraphicItem::QgsModelOutputGraphicItem( QgsProcessingModelOutput *output, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
1345 : QgsModelComponentGraphicItem( output, model, parent )
1348 QPainter painter( &mPicture );
1349 svg.render( &painter );
1351 setLabel( output->description() );
1354QColor QgsModelOutputGraphicItem::fillColor( QgsModelComponentGraphicItem::State state )
const
1356 QColor
c( 172, 196, 114 );
1360 c =
c.darker( 110 );
1363 c =
c.darker( 105 );
1372QColor QgsModelOutputGraphicItem::strokeColor( QgsModelComponentGraphicItem::State state )
const
1377 return QColor( 42, 65, 42 );
1380 return QColor( 90, 140, 90 );
1385QColor QgsModelOutputGraphicItem::textColor( QgsModelComponentGraphicItem::State )
const
1390QPicture QgsModelOutputGraphicItem::iconPicture()
const
1395void QgsModelOutputGraphicItem::updateStoredComponentPosition(
const QPointF &pos,
const QSizeF &size )
1397 if ( QgsProcessingModelOutput *output =
dynamic_cast<QgsProcessingModelOutput *
>( component() ) )
1399 model()->childAlgorithm( output->childId() ).modelOutput( output->name() ).setPosition( pos );
1400 model()->childAlgorithm( output->childId() ).modelOutput( output->name() ).setSize( size );
1404bool QgsModelOutputGraphicItem::canDeleteComponent()
1406 if (
dynamic_cast<const QgsProcessingModelOutput *
>( component() ) )
1413void QgsModelOutputGraphicItem::deleteComponent()
1415 if (
const QgsProcessingModelOutput *output =
dynamic_cast<const QgsProcessingModelOutput *
>( component() ) )
1417 emit aboutToChange( tr(
"Delete Output %1" ).arg( output->description() ) );
1418 model()->childAlgorithm( output->childId() ).removeModelOutput( output->name() );
1419 model()->updateDestinationParameters();
1421 emit requestModelRepaint();
1430QgsModelGroupBoxGraphicItem::QgsModelGroupBoxGraphicItem( QgsProcessingModelGroupBox *box, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
1431 : QgsModelComponentGraphicItem( box, model, parent )
1433 setZValue( QgsModelGraphicsScene::ZValues::GroupBox );
1434 setLabel( box->description() );
1438 f.setPixelSize( 14 );
1442void QgsModelGroupBoxGraphicItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
1444 QMenu *popupmenu =
new QMenu( event->widget() );
1445 QAction *removeAction = popupmenu->addAction( QObject::tr(
"Remove" ) );
1446 connect( removeAction, &QAction::triggered,
this, &QgsModelGroupBoxGraphicItem::deleteComponent );
1447 QAction *editAction = popupmenu->addAction( QObject::tr(
"Edit…" ) );
1448 connect( editAction, &QAction::triggered,
this, &QgsModelGroupBoxGraphicItem::editComponent );
1449 popupmenu->exec( event->screenPos() );
1452QgsModelGroupBoxGraphicItem::~QgsModelGroupBoxGraphicItem() =
default;
1454QColor QgsModelGroupBoxGraphicItem::fillColor( QgsModelComponentGraphicItem::State state )
const
1456 QColor
c( 230, 230, 230 );
1460 c =
c.darker( 110 );
1463 c =
c.darker( 105 );
1472QColor QgsModelGroupBoxGraphicItem::strokeColor( QgsModelComponentGraphicItem::State state )
const
1477 return QColor( 50, 50, 50 );
1480 return QColor( 150, 150, 150 );
1485QColor QgsModelGroupBoxGraphicItem::textColor( QgsModelComponentGraphicItem::State )
const
1487 return QColor( 100, 100, 100 );
1490Qt::PenStyle QgsModelGroupBoxGraphicItem::strokeStyle( QgsModelComponentGraphicItem::State )
const
1495Qt::Alignment QgsModelGroupBoxGraphicItem::titleAlignment()
const
1497 return Qt::AlignHCenter;
1500void QgsModelGroupBoxGraphicItem::updateStoredComponentPosition(
const QPointF &pos,
const QSizeF &size )
1502 if ( QgsProcessingModelGroupBox *box =
dynamic_cast<QgsProcessingModelGroupBox *
>( component() ) )
1504 box->setPosition( pos );
1505 box->setSize( size );
1506 model()->addGroupBox( *box );
1510bool QgsModelGroupBoxGraphicItem::canDeleteComponent()
1512 if (
dynamic_cast<QgsProcessingModelGroupBox *
>( component() ) )
1519void QgsModelGroupBoxGraphicItem::deleteComponent()
1521 if (
const QgsProcessingModelGroupBox *box =
dynamic_cast<const QgsProcessingModelGroupBox *
>( component() ) )
1523 emit aboutToChange( tr(
"Delete Group Box" ) );
1524 model()->removeGroupBox( box->uuid() );
1526 emit requestModelRepaint();
1530void QgsModelGroupBoxGraphicItem::editComponent()
1532 if (
const QgsProcessingModelGroupBox *box =
dynamic_cast<const QgsProcessingModelGroupBox *
>( component() ) )
1538 emit aboutToChange( tr(
"Edit Group Box" ) );
1539 model()->addGroupBox( dlg.groupBox() );
1541 emit requestModelRepaint();
1550QgsModelCommentGraphicItem::QgsModelCommentGraphicItem( QgsProcessingModelComment *comment, QgsModelComponentGraphicItem *parentItem, QgsProcessingModelAlgorithm *model, QGraphicsItem *parent )
1551 : QgsModelComponentGraphicItem( comment, model, parent )
1552 , mParentComponent( parentItem->component()->clone() )
1553 , mParentItem( parentItem )
1555 setLabel( comment->description() );
1558 f.setPixelSize( 9 );
1562void QgsModelCommentGraphicItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
1564 QMenu *popupmenu =
new QMenu( event->widget() );
1565 QAction *removeAction = popupmenu->addAction( QObject::tr(
"Remove" ) );
1566 connect( removeAction, &QAction::triggered,
this, &QgsModelCommentGraphicItem::deleteComponent );
1567 QAction *editAction = popupmenu->addAction( QObject::tr(
"Edit…" ) );
1568 connect( editAction, &QAction::triggered,
this, &QgsModelCommentGraphicItem::editComponent );
1569 popupmenu->exec( event->screenPos() );
1572QgsModelCommentGraphicItem::~QgsModelCommentGraphicItem() =
default;
1574QColor QgsModelCommentGraphicItem::fillColor( QgsModelComponentGraphicItem::State state )
const
1576 QColor
c( 230, 230, 230 );
1580 c =
c.darker( 110 );
1583 c =
c.darker( 105 );
1592QColor QgsModelCommentGraphicItem::strokeColor( QgsModelComponentGraphicItem::State state )
const
1597 return QColor( 50, 50, 50 );
1600 return QColor( 150, 150, 150 );
1605QColor QgsModelCommentGraphicItem::textColor( QgsModelComponentGraphicItem::State )
const
1607 return QColor( 100, 100, 100 );
1610Qt::PenStyle QgsModelCommentGraphicItem::strokeStyle( QgsModelComponentGraphicItem::State )
const
1615void QgsModelCommentGraphicItem::updateStoredComponentPosition(
const QPointF &pos,
const QSizeF &size )
1617 if ( QgsProcessingModelComment *comment = modelComponent() )
1619 comment->setPosition( pos );
1620 comment->setSize( size );
1624bool QgsModelCommentGraphicItem::canDeleteComponent()
1626 if ( modelComponent() )
1633void QgsModelCommentGraphicItem::deleteComponent()
1635 if ( QgsProcessingModelComment *comment = modelComponent() )
1637 emit aboutToChange( tr(
"Delete Comment" ) );
1638 comment->setDescription( QString() );
1640 emit requestModelRepaint();
1644void QgsModelCommentGraphicItem::editComponent()
1648 mParentItem->editComment();
1652QgsProcessingModelComment *QgsModelCommentGraphicItem::modelComponent()
1654 if (
const QgsProcessingModelChildAlgorithm *child =
dynamic_cast<const QgsProcessingModelChildAlgorithm *
>( mParentComponent.get() ) )
1656 return model()->childAlgorithm( child->childId() ).comment();
1658 else if (
const QgsProcessingModelParameter *param =
dynamic_cast<const QgsProcessingModelParameter *
>( mParentComponent.get() ) )
1660 return model()->parameterComponent( param->parameterName() ).comment();
1662 else if (
const QgsProcessingModelOutput *output =
dynamic_cast<const QgsProcessingModelOutput *
>( mParentComponent.get() ) )
1664 return model()->childAlgorithm( output->childId() ).modelOutput( output->name() ).comment();
1669QgsModelComponentGraphicItem *QgsModelCommentGraphicItem::parentComponentItem()
const
@ Success
Child was successfully executed.
@ NotExecuted
Child has not been executed.
@ Failed
Child encountered an error while executing.
@ Warning
Warning message.
@ ExpressionText
Parameter value is taken from a text with expressions, evaluated just before the algorithm runs.
@ ModelOutput
Parameter value is linked to an output parameter for the model.
@ ChildOutput
Parameter value is taken from an output generated by a child algorithm.
@ ModelParameter
Parameter value is taken from a parent model parameter.
@ StaticValue
Parameter value is a static value.
@ Expression
Parameter value is taken from an expression, evaluated just before the algorithm runs.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE())
Adds a message to the log instance (and creates it if necessary).
A widget which allows users to specify the properties of a model group box.
A mouse event which is the result of a user interaction with a QgsModelGraphicsView.
QPointF modelPoint() const
Returns the event point location in model coordinates.
Abstract base class for processing algorithms.
Encapsulates the results of running a child algorithm within a model.
Base class for the definition of processing outputs.
QString description() const
Returns the description for the output.
Base class for the definition of processing parameters.
virtual QString userFriendlyString(const QVariant &value) const
Returns a user-friendly string representation of the provided parameter value.
QString description() const
Returns the description for the parameter.
QString name() const
Returns the name of the parameter.
A rectangle specified with double values.
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
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 c
QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions
List of processing parameters.