31#include <QGraphicsSceneMouseEvent>
32#include <QGraphicsTextItem>
36#include "moc_qgsmodelgraphicsscene.cpp"
38using namespace Qt::StringLiterals;
42QgsModelGraphicsScene::QgsModelGraphicsScene( QObject *parent )
43 : QGraphicsScene( parent )
45 setItemIndexMethod( QGraphicsScene::NoIndex );
47 connect(
this, &QgsModelGraphicsScene::componentChanged,
this, &QgsModelGraphicsScene::updateBounds );
50QgsProcessingModelAlgorithm *QgsModelGraphicsScene::model()
55void QgsModelGraphicsScene::setModel( QgsProcessingModelAlgorithm *model )
60void QgsModelGraphicsScene::setFlag( QgsModelGraphicsScene::Flag flag,
bool on )
68void QgsModelGraphicsScene::mousePressEvent( QGraphicsSceneMouseEvent *event )
70 if ( event->button() != Qt::LeftButton )
72 QGraphicsScene::mousePressEvent( event );
75void QgsModelGraphicsScene::updateBounds()
81 const QList<QGraphicsItem *> constItems = items();
82 for ( QGraphicsItem *item : constItems )
84 QgsModelComponentGraphicItem *componentItem =
dynamic_cast<QgsModelComponentGraphicItem *
>( item );
86 bounds = bounds.united( componentItem->sceneBoundingRect() );
89 if ( bounds.isValid() )
92 bounds.adjust( -SCENE_COMPONENT_MARGIN, -SCENE_COMPONENT_MARGIN, SCENE_COMPONENT_MARGIN, SCENE_COMPONENT_MARGIN );
93 bounds.setLeft( std::floor( bounds.left() ) );
94 bounds.setTop( std::floor( bounds.top() ) );
95 bounds.setRight( std::ceil( bounds.right() ) );
96 bounds.setBottom( std::ceil( bounds.bottom() ) );
99 setSceneRect( bounds );
105 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
107 item->setProgress( progress );
112 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
119 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
121 item->setResults( result );
126 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
128 item->setSinkFeatureCount( outputName, featureCount );
133 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
135 item->setSourceFeatureCount( parameterName, featureCount );
140void QgsModelGraphicsScene::flagChildrenAsOutdated(
const QSet<QString> &children )
142 for (
const QString &child : children )
144 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( child ) )
151QgsModelComponentGraphicItem *QgsModelGraphicsScene::createParameterGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelParameter *param )
const
153 return new QgsModelParameterGraphicItem( param, model,
nullptr );
156QgsModelChildAlgorithmGraphicItem *QgsModelGraphicsScene::createChildAlgGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelChildAlgorithm *child )
const
158 return new QgsModelChildAlgorithmGraphicItem( child, model,
nullptr );
161QgsModelComponentGraphicItem *QgsModelGraphicsScene::createOutputGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelOutput *output )
const
163 return new QgsModelOutputGraphicItem( output, model,
nullptr );
166QgsModelComponentGraphicItem *QgsModelGraphicsScene::createCommentGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelComment *comment, QgsModelComponentGraphicItem *parentItem )
const
168 return new QgsModelCommentGraphicItem( comment, parentItem, model,
nullptr );
171QgsModelComponentGraphicItem *QgsModelGraphicsScene::createGroupBoxGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelGroupBox *box )
const
173 return new QgsModelGroupBoxGraphicItem( box, model,
nullptr );
176void QgsModelGraphicsScene::createItems( QgsProcessingModelAlgorithm *model,
QgsProcessingContext &context )
179 const QList<QgsProcessingModelGroupBox> boxes = model->groupBoxes();
180 mGroupBoxItems.clear();
181 for (
const QgsProcessingModelGroupBox &box : boxes )
183 QgsModelComponentGraphicItem *item = createGroupBoxGraphicItem( model, box.clone() );
185 item->setPos( box.position().x(), box.position().y() );
186 mGroupBoxItems.insert( box.uuid(), item );
187 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint,
this, &QgsModelGraphicsScene::rebuildRequired );
188 connect( item, &QgsModelComponentGraphicItem::changed,
this, &QgsModelGraphicsScene::componentChanged );
189 connect( item, &QgsModelComponentGraphicItem::aboutToChange,
this, &QgsModelGraphicsScene::componentAboutToChange );
193 const QMap<QString, QgsProcessingModelParameter> params = model->parameterComponents();
194 for (
auto it = params.constBegin(); it != params.constEnd(); ++it )
196 QgsModelComponentGraphicItem *item = createParameterGraphicItem( model, it.value().clone() );
198 item->setPos( it.value().position().x(), it.value().position().y() );
199 mParameterItems.insert( it.value().parameterName(), item );
200 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint,
this, &QgsModelGraphicsScene::rebuildRequired );
201 connect( item, &QgsModelComponentGraphicItem::changed,
this, &QgsModelGraphicsScene::componentChanged );
202 connect( item, &QgsModelComponentGraphicItem::aboutToChange,
this, &QgsModelGraphicsScene::componentAboutToChange );
204 addCommentItemForComponent( model, it.value(), item );
208 for (
auto it = params.constBegin(); it != params.constEnd(); ++it )
212 for (
const QString &otherName : parameterLinks )
214 if ( mParameterItems.contains( it.key() ) && mParameterItems.contains( otherName ) )
216 auto arrow = std::make_unique<QgsModelArrowItem>( mParameterItems.value( otherName ), QgsModelArrowItem::Marker::Circle, mParameterItems.value( it.key() ), QgsModelArrowItem::Marker::ArrowHead );
217 arrow->setPenStyle( Qt::DotLine );
218 addItem( arrow.release() );
224 const QMap<QString, QgsProcessingModelChildAlgorithm> childAlgs = model->childAlgorithms();
225 for (
auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
227 QgsModelChildAlgorithmGraphicItem *item = createChildAlgGraphicItem( model, it.value().clone() );
229 item->setPos( it.value().position().x(), it.value().position().y() );
231 const QString childId = it.value().childId();
232 mChildAlgorithmItems.insert( childId, item );
233 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint,
this, &QgsModelGraphicsScene::rebuildRequired );
234 connect( item, &QgsModelComponentGraphicItem::changed,
this, &QgsModelGraphicsScene::componentChanged );
235 connect( item, &QgsModelComponentGraphicItem::aboutToChange,
this, &QgsModelGraphicsScene::componentAboutToChange );
236 connect( item, &QgsModelChildAlgorithmGraphicItem::runFromHere,
this, [
this, childId] { emit runFromChild( childId ); } );
237 connect( item, &QgsModelChildAlgorithmGraphicItem::runSelected,
this, &QgsModelGraphicsScene::runSelected );
238 connect( item, &QgsModelChildAlgorithmGraphicItem::showPreviousResults,
this, [
this, childId] { emit showChildAlgorithmOutputs( childId ); } );
239 connect( item, &QgsModelChildAlgorithmGraphicItem::showLog,
this, [
this, childId] { emit showChildAlgorithmLog( childId ); } );
241 addCommentItemForComponent( model, it.value(), item );
245 for (
auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
249 if ( !it.value().algorithm() )
257 QList<QgsProcessingModelChildParameterSource> sources;
258 if ( it.value().parameterSources().contains( parameter->name() ) )
259 sources = it.value().parameterSources()[parameter->name()];
260 for (
const QgsProcessingModelChildParameterSource &source : std::as_const( sources ) )
262 const QList<LinkSource> sourceItems = linkSourcesForParameterValue( model, QVariant::fromValue( source ), it.value().childId(), context );
263 for (
const LinkSource &link : sourceItems )
267 QgsModelArrowItem *arrow =
nullptr;
268 if ( link.linkIndex == -1 )
270 arrow =
new QgsModelArrowItem(
272 QgsModelArrowItem::Marker::NoMarker,
273 mChildAlgorithmItems.value( it.value().childId() ),
274 parameter->isDestination() ? Qt::BottomEdge : Qt::TopEdge,
275 parameter->isDestination() ? bottomIdx : topIdx,
276 QgsModelArrowItem::Marker::Circle
281 arrow =
new QgsModelArrowItem(
286 QgsModelArrowItem::Marker::NoMarker,
287 mChildAlgorithmItems.value( it.value().childId() ),
288 parameter->isDestination() ? Qt::BottomEdge : Qt::TopEdge,
289 parameter->isDestination() ? bottomIdx : topIdx,
291 QgsModelArrowItem::Marker::NoMarker
296 const QString layerId = mLastResult.childResults().value( it.value().childId() ).inputs().value( parameter->name() ).toString();
297 addFeatureCountItemForArrow( arrow, layerId );
300 if ( parameter->isDestination() )
306 const QList<QgsProcessingModelChildDependency> dependencies = it.value().dependencies();
307 for (
const QgsProcessingModelChildDependency &depend : dependencies )
309 if ( depend.conditionalBranch.isEmpty() || !model->childAlgorithm( depend.childId ).algorithm() )
312 new QgsModelArrowItem( mChildAlgorithmItems.value( depend.childId ), QgsModelArrowItem::Marker::Circle, mChildAlgorithmItems.value( it.value().childId() ), QgsModelArrowItem::Marker::ArrowHead )
323 if ( output->name() == depend.conditionalBranch )
332 new QgsModelArrowItem( mChildAlgorithmItems.value( depend.childId ), Qt::BottomEdge, i, QgsModelArrowItem::Marker::Circle, mChildAlgorithmItems.value( it.value().childId() ), QgsModelArrowItem::Marker::ArrowHead )
339 for (
auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
341 const QMap<QString, QgsProcessingModelOutput> outputs = it.value().modelOutputs();
342 QMap<QString, QgsModelComponentGraphicItem *> outputItems;
346 QgsProcessingModelComponent *algItem = mChildAlgorithmItems[it.value().childId()]->component();
347 const double outputOffsetX = algItem->size().width();
348 double outputOffsetY = 1.5 * algItem->size().height();
350 for (
auto outputIt = outputs.constBegin(); outputIt != outputs.constEnd(); ++outputIt )
352 QgsModelComponentGraphicItem *item = createOutputGraphicItem( model, outputIt.value().clone() );
354 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint,
this, &QgsModelGraphicsScene::rebuildRequired );
355 connect( item, &QgsModelComponentGraphicItem::changed,
this, &QgsModelGraphicsScene::componentChanged );
356 connect( item, &QgsModelComponentGraphicItem::aboutToChange,
this, &QgsModelGraphicsScene::componentAboutToChange );
361 QPointF pos = outputIt.value().position();
364 pos = algItem->position() + QPointF( outputOffsetX, outputOffsetY );
365 outputOffsetY += 1.5 * outputIt.value().size().height();
370 if ( it.value().algorithm() )
375 if ( childAlgOutput->name() == outputIt.value().childOutputName() )
385 item->component()->setPosition( pos );
386 outputItems.insert( outputIt.value().childOutputName(), item );
387 QgsModelArrowItem *arrow =
new QgsModelArrowItem( mChildAlgorithmItems[it.value().childId()], Qt::BottomEdge, idx, QgsModelArrowItem::Marker::Circle, item, QgsModelArrowItem::Marker::Circle );
390 QString layerId = mLastResult.childResults().value( it.value().childId() ).outputs().value( outputIt.value().childOutputName() ).toString();
391 addFeatureCountItemForArrow( arrow, layerId );
393 addCommentItemForComponent( model, outputIt.value(), item );
395 mOutputItems.insert( it.value().childId(), outputItems );
399 for (
auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
401 const QString childId = it.value().childId();
402 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( it.key() ) )
404 item->setResults( mLastResult.childResults().value( childId ) );
409QList<QgsModelComponentGraphicItem *> QgsModelGraphicsScene::selectedComponentItems()
411 QList<QgsModelComponentGraphicItem *> componentItemList;
413 const QList<QGraphicsItem *> graphicsItemList = selectedItems();
414 for ( QGraphicsItem *item : graphicsItemList )
416 if ( QgsModelComponentGraphicItem *componentItem =
dynamic_cast<QgsModelComponentGraphicItem *
>( item ) )
418 componentItemList.push_back( componentItem );
422 return componentItemList;
425QgsModelComponentGraphicItem *QgsModelGraphicsScene::componentItemAt( QPointF position )
const
428 const QList<QGraphicsItem *> itemList = items( position, Qt::IntersectsItemShape, Qt::DescendingOrder );
430 for ( QGraphicsItem *graphicsItem : itemList )
432 if ( QgsModelComponentGraphicItem *componentItem =
dynamic_cast<QgsModelComponentGraphicItem *
>( graphicsItem ) )
434 return componentItem;
440QgsModelComponentGraphicItem *QgsModelGraphicsScene::groupBoxItem(
const QString &uuid )
442 return mGroupBoxItems.value( uuid );
445QgsModelChildAlgorithmGraphicItem *QgsModelGraphicsScene::childAlgorithmItem(
const QString &childId )
447 return mChildAlgorithmItems.value( childId );
450void QgsModelGraphicsScene::resetChildAlgorithmItems(
const QSet<QString> &childAlgorithmSubset )
452 if ( !childAlgorithmSubset.isEmpty() )
454 for (
const QString &childId : childAlgorithmSubset )
456 if ( QgsModelChildAlgorithmGraphicItem *item = childAlgorithmItem( childId ) )
464 for (
auto it = mChildAlgorithmItems.constBegin(); it != mChildAlgorithmItems.constEnd(); ++it )
471QgsModelComponentGraphicItem *QgsModelGraphicsScene::parameterItem(
const QString &name )
473 return mParameterItems.value( name );
476QgsModelComponentGraphicItem *QgsModelGraphicsScene::outputItem(
const QString &childId,
const QString &childOutputName )
478 auto it = mOutputItems.constFind( childId );
479 if ( it == mOutputItems.constEnd() )
482 auto outputIt = it->constFind( childOutputName );
483 if ( outputIt == it->constEnd() )
486 return outputIt.value();
489void QgsModelGraphicsScene::selectAll()
492 QgsModelComponentGraphicItem *focusedItem =
nullptr;
493 const QList<QGraphicsItem *> itemList = items();
494 for ( QGraphicsItem *graphicsItem : itemList )
496 if ( QgsModelComponentGraphicItem *componentItem =
dynamic_cast<QgsModelComponentGraphicItem *
>( graphicsItem ) )
498 componentItem->setSelected(
true );
500 focusedItem = componentItem;
503 emit selectedItemChanged( focusedItem );
506void QgsModelGraphicsScene::deselectAll()
511 const QList<QGraphicsItem *> selectedItemList = selectedItems();
512 for ( QGraphicsItem *item : selectedItemList )
514 if ( QgsModelComponentGraphicItem *componentItem =
dynamic_cast<QgsModelComponentGraphicItem *
>( item ) )
516 componentItem->setSelected(
false );
519 emit selectedItemChanged(
nullptr );
522void QgsModelGraphicsScene::setSelectedItem( QgsModelComponentGraphicItem *item )
527 item->setSelected(
true );
529 emit selectedItemChanged( item );
534 mLastResult = result;
537 for (
auto it = childResults.constBegin(); it != childResults.constEnd(); ++it )
539 if ( QgsModelChildAlgorithmGraphicItem *item = mChildAlgorithmItems.value( it.key() ) )
541 item->setResults( it.value() );
545 mLastResultCount.clear();
547 for (
auto it = childResults.constBegin(); it != childResults.constEnd(); ++it )
549 QVariantMap inputs = childResults.value( it.key() ).inputs();
550 for (
auto inputIt = inputs.constBegin(); inputIt != inputs.constEnd(); inputIt++ )
554 QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( resultMapLayer );
557 mLastResultCount.insert( inputs.value( inputIt.key() ).toString(), vl->
featureCount() );
562 QVariantMap outputs = childResults.value( it.key() ).outputs();
563 for (
auto outputIt = outputs.constBegin(); outputIt != outputs.constEnd(); outputIt++ )
567 QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( resultMapLayer );
570 mLastResultCount.insert( outputs.value( outputIt.key() ).toString(), vl->
featureCount() );
576 emit requestRebuildRequired();
579QList<QgsModelGraphicsScene::LinkSource> QgsModelGraphicsScene::linkSourcesForParameterValue(
580 QgsProcessingModelAlgorithm *model,
const QVariant &value,
const QString &childId,
QgsProcessingContext &context
583 QList<QgsModelGraphicsScene::LinkSource> res;
584 if ( value.userType() == QMetaType::Type::QVariantList )
586 const QVariantList list = value.toList();
587 for (
const QVariant &v : list )
588 res.append( linkSourcesForParameterValue( model, v, childId, context ) );
590 else if ( value.userType() == QMetaType::Type::QStringList )
592 const QStringList list = value.toStringList();
593 for (
const QString &v : list )
594 res.append( linkSourcesForParameterValue( model, v, childId, context ) );
596 else if ( value.userType() == qMetaTypeId<QgsProcessingModelChildParameterSource>() )
598 const QgsProcessingModelChildParameterSource source = value.value<QgsProcessingModelChildParameterSource>();
599 switch ( source.source() )
604 l.item = mParameterItems.value( source.parameterName() );
605 l.edge = Qt::BottomEdge;
613 if ( !model->childAlgorithm( source.outputChildId() ).algorithm() )
620 if ( output->name() == source.outputName() )
624 if ( mChildAlgorithmItems.contains( source.outputChildId() ) )
627 l.item = mChildAlgorithmItems.value( source.outputChildId() );
628 l.edge = Qt::BottomEdge;
631 if ( i >= model->childAlgorithm( source.outputChildId() ).algorithm()->outputDefinitions().length() )
633 QString short_message = tr(
"Check output links for alg: %1" ).arg( model->childAlgorithm( source.outputChildId() ).algorithm()->name() );
634 QString long_message = tr(
"Cannot link output for alg: %1" ).arg( model->childAlgorithm( source.outputChildId() ).algorithm()->name() );
635 QString title( tr(
"Algorithm link error" ) );
637 showWarning(
const_cast<QString &
>( short_message ),
const_cast<QString &
>( title ),
const_cast<QString &
>( long_message ) );
652 const QMap<QString, QgsProcessingModelAlgorithm::VariableDefinition> variables = model->variablesForChildAlgorithm( childId, &context );
654 const QSet<QString> vars = exp.referencedVariables();
655 for (
const QString &v : vars )
657 if ( variables.contains( v ) )
659 res.append( linkSourcesForParameterValue( model, QVariant::fromValue( variables.value( v ).source ), childId, context ) );
674void QgsModelGraphicsScene::addCommentItemForComponent( QgsProcessingModelAlgorithm *model,
const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem )
676 if ( mFlags & FlagHideComments || !component.comment() || component.comment()->description().isEmpty() )
679 QgsModelComponentGraphicItem *commentItem = createCommentGraphicItem( model, component.comment()->clone(), parentItem );
680 commentItem->setPos( component.comment()->position().x(), component.comment()->position().y() );
681 addItem( commentItem );
682 connect( commentItem, &QgsModelComponentGraphicItem::requestModelRepaint,
this, &QgsModelGraphicsScene::rebuildRequired );
683 connect( commentItem, &QgsModelComponentGraphicItem::changed,
this, &QgsModelGraphicsScene::componentChanged );
684 connect( commentItem, &QgsModelComponentGraphicItem::aboutToChange,
this, &QgsModelGraphicsScene::componentAboutToChange );
686 auto arrow = std::make_unique<QgsModelArrowItem>( parentItem, QgsModelArrowItem::Circle, commentItem, QgsModelArrowItem::Circle );
687 arrow->setPenStyle( Qt::DotLine );
688 addItem( arrow.release() );
692void QgsModelGraphicsScene::addFeatureCountItemForArrow( QgsModelArrowItem *arrow,
const QString &layerId )
694 if ( mFlags & FlagHideFeatureCount )
696 arrow->setShowBadge(
false );
700 if ( !mLastResultCount.contains( layerId ) )
702 arrow->setShowBadge(
false );
706 arrow->setShowBadge(
true );
707 if ( QgsModelDesignerArrowBadgeItem *badge = arrow->badgeItem() )
709 badge->setValue( mLastResultCount.value( layerId ) );
719void QgsModelGraphicsScene::setMessageBar(
QgsMessageBar *messageBar )
721 mMessageBar = messageBar;
724void QgsModelGraphicsScene::showWarning(
const QString &shortMessage,
const QString &title,
const QString &longMessage,
Qgis::MessageLevel level )
const
727 QPushButton *detailsButton =
new QPushButton( tr(
"Details" ) );
728 connect( detailsButton, &QPushButton::clicked, detailsButton, [detailsButton, title, longMessage] {
734 messageWidget->layout()->addWidget( detailsButton );
735 mMessageBar->clearWidgets();
736 mMessageBar->pushWidget( messageWidget, level, 0 );
739void QgsModelGraphicsScene::requestRebuildRequired()
741 emit rebuildRequired();
MessageLevel
Level for messages This will be used both for message log and message bar in application.
@ 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.
@ Hidden
Parameter is hidden and should not be shown to users.
Handles parsing and evaluation of expressions (formerly called "search strings").
Base class for all map layer types.
Represents an item shown within a QgsMessageBar widget.
A bar for displaying non-blocking messages to the user.
static QgsMessageBarItem * createMessage(const QString &text, QWidget *parent=nullptr)
Creates message bar item widget containing a message text to be displayed on the bar.
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(), Qgis::StringFormat format=Qgis::StringFormat::PlainText)
Adds a message to the log instance (and creates it if necessary).
A generic message view for displaying QGIS messages.
void setMessage(const QString &message, Qgis::StringFormat format) override
Sets message, it won't be displayed until.
void setTitle(const QString &title) override
Sets title for the messages.
void showMessage(bool blocking=true) override
display the message to the user and deletes itself
Contains information about the context in which a processing algorithm is executed.
Encapsulates the results of running a child algorithm within a model.
A Processing feedback class with extra signals and properties specific to feedback from Processing mo...
void childStarted(const QString &childId, const QVariantMap &childParameters)
Emitted when a child algorithm has started executing.
void childResultReported(const QString &childId, const QgsProcessingModelChildAlgorithmResult &result)
Emitted when the result of a child algorithm has been reported.
void childSourceLoaded(const QString &childId, const QString ¶meterName, long long featureCount)
Emitted when a feature source was retrieved for the specified child algorithm input parameter.
void childProgressChanged(const QString &childId, double progress)
Emitted when a child algorithm changes progress.
void childSinkFeatureCountChanged(const QString &childId, const QString &childOutput, long long featureCount)
Emitted when the count of features pushed to a child's sink has changed.
Encapsulates the results of running a Processing model.
QMap< QString, QgsProcessingModelChildAlgorithmResult > childResults() const
Returns the map of child algorithm results.
Base class for the definition of processing outputs.
Base class for the definition of processing parameters.
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
static QgsMapLayer * mapLayerFromString(const QString &string, QgsProcessingContext &context, bool allowLoadingNewLayers=true, QgsProcessingUtils::LayerHint typeHint=QgsProcessingUtils::LayerHint::UnknownType, QgsProcessing::LayerOptionsFlags flags=QgsProcessing::LayerOptionsFlags())
Interprets a string as a map layer within the supplied context.
Represents a vector layer which manages a vector based dataset.
long long featureCount(const QString &legendKey) const
Number of features rendered with specified legend key.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< const QgsProcessingOutputDefinition * > QgsProcessingOutputDefinitions
List of processing parameters.
QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions
List of processing parameters.