QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmodelgraphicsscene.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodelgraphicsscene.cpp
3 ----------------------------------
4 Date : March 2020
5 Copyright : (C) 2020 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include "qgsmessagebar.h"
19#include "qgsmessagebaritem.h"
20#include "qgsmessagelog.h"
21#include "qgsmessageviewer.h"
22#include "qgsmodelarrowitem.h"
27
28#include <QGraphicsSceneMouseEvent>
29#include <QPushButton>
30
31#include "moc_qgsmodelgraphicsscene.cpp"
32
34
35QgsModelGraphicsScene::QgsModelGraphicsScene( QObject *parent )
36 : QGraphicsScene( parent )
37{
38 setItemIndexMethod( QGraphicsScene::NoIndex );
39
40 connect( this, &QgsModelGraphicsScene::componentChanged, this, &QgsModelGraphicsScene::updateBounds );
41}
42
43QgsProcessingModelAlgorithm *QgsModelGraphicsScene::model()
44{
45 return mModel;
46}
47
48void QgsModelGraphicsScene::setModel( QgsProcessingModelAlgorithm *model )
49{
50 mModel = model;
51}
52
53void QgsModelGraphicsScene::setFlag( QgsModelGraphicsScene::Flag flag, bool on )
54{
55 if ( on )
56 mFlags |= flag;
57 else
58 mFlags &= ~flag;
59}
60
61void QgsModelGraphicsScene::mousePressEvent( QGraphicsSceneMouseEvent *event )
62{
63 if ( event->button() != Qt::LeftButton )
64 return;
65 QGraphicsScene::mousePressEvent( event );
66}
67
68void QgsModelGraphicsScene::updateBounds()
69{
70 //start with an empty rectangle
71 QRectF bounds;
72
73 //add all items
74 const QList<QGraphicsItem *> constItems = items();
75 for ( QGraphicsItem *item : constItems )
76 {
77 QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item );
78 if ( componentItem )
79 bounds = bounds.united( componentItem->sceneBoundingRect() );
80 }
81
82 if ( bounds.isValid() )
83 {
84 bounds.adjust( -SCENE_COMPONENT_MARGIN, -SCENE_COMPONENT_MARGIN, SCENE_COMPONENT_MARGIN, SCENE_COMPONENT_MARGIN );
85 }
86
87 setSceneRect( bounds );
88}
89
90QgsModelComponentGraphicItem *QgsModelGraphicsScene::createParameterGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelParameter *param ) const
91{
92 return new QgsModelParameterGraphicItem( param, model, nullptr );
93}
94
95QgsModelChildAlgorithmGraphicItem *QgsModelGraphicsScene::createChildAlgGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelChildAlgorithm *child ) const
96{
97 return new QgsModelChildAlgorithmGraphicItem( child, model, nullptr );
98}
99
100QgsModelComponentGraphicItem *QgsModelGraphicsScene::createOutputGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelOutput *output ) const
101{
102 return new QgsModelOutputGraphicItem( output, model, nullptr );
103}
104
105QgsModelComponentGraphicItem *QgsModelGraphicsScene::createCommentGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelComment *comment, QgsModelComponentGraphicItem *parentItem ) const
106{
107 return new QgsModelCommentGraphicItem( comment, parentItem, model, nullptr );
108}
109
110QgsModelComponentGraphicItem *QgsModelGraphicsScene::createGroupBoxGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelGroupBox *box ) const
111{
112 return new QgsModelGroupBoxGraphicItem( box, model, nullptr );
113}
114
115void QgsModelGraphicsScene::createItems( QgsProcessingModelAlgorithm *model, QgsProcessingContext &context )
116{
117 // model group boxes
118 const QList<QgsProcessingModelGroupBox> boxes = model->groupBoxes();
119 mGroupBoxItems.clear();
120 for ( const QgsProcessingModelGroupBox &box : boxes )
121 {
122 QgsModelComponentGraphicItem *item = createGroupBoxGraphicItem( model, box.clone() );
123 addItem( item );
124 item->setPos( box.position().x(), box.position().y() );
125 mGroupBoxItems.insert( box.uuid(), item );
126 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint, this, &QgsModelGraphicsScene::rebuildRequired );
127 connect( item, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged );
128 connect( item, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange );
129 }
130
131 // model input parameters
132 const QMap<QString, QgsProcessingModelParameter> params = model->parameterComponents();
133 for ( auto it = params.constBegin(); it != params.constEnd(); ++it )
134 {
135 QgsModelComponentGraphicItem *item = createParameterGraphicItem( model, it.value().clone() );
136 addItem( item );
137 item->setPos( it.value().position().x(), it.value().position().y() );
138 mParameterItems.insert( it.value().parameterName(), item );
139 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint, this, &QgsModelGraphicsScene::rebuildRequired );
140 connect( item, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged );
141 connect( item, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange );
142
143 addCommentItemForComponent( model, it.value(), item );
144 }
145
146 // input dependency arrows
147 for ( auto it = params.constBegin(); it != params.constEnd(); ++it )
148 {
149 const QgsProcessingParameterDefinition *parameterDef = model->parameterDefinition( it.key() );
150 const QStringList parameterLinks = parameterDef->dependsOnOtherParameters();
151 for ( const QString &otherName : parameterLinks )
152 {
153 if ( mParameterItems.contains( it.key() ) && mParameterItems.contains( otherName ) )
154 {
155 auto arrow = std::make_unique<QgsModelArrowItem>( mParameterItems.value( otherName ), QgsModelArrowItem::Marker::Circle, mParameterItems.value( it.key() ), QgsModelArrowItem::Marker::ArrowHead );
156 arrow->setPenStyle( Qt::DotLine );
157 addItem( arrow.release() );
158 }
159 }
160 }
161
162 // child algorithms
163 const QMap<QString, QgsProcessingModelChildAlgorithm> childAlgs = model->childAlgorithms();
164 for ( auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
165 {
166 QgsModelChildAlgorithmGraphicItem *item = createChildAlgGraphicItem( model, it.value().clone() );
167 addItem( item );
168 item->setPos( it.value().position().x(), it.value().position().y() );
169
170 const QString childId = it.value().childId();
171 item->setResults( mLastResult.childResults().value( childId ) );
172 mChildAlgorithmItems.insert( childId, item );
173 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint, this, &QgsModelGraphicsScene::rebuildRequired );
174 connect( item, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged );
175 connect( item, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange );
176 connect( item, &QgsModelChildAlgorithmGraphicItem::runFromHere, this, [this, childId] {
177 emit runFromChild( childId );
178 } );
179 connect( item, &QgsModelChildAlgorithmGraphicItem::runSelected, this, &QgsModelGraphicsScene::runSelected );
180 connect( item, &QgsModelChildAlgorithmGraphicItem::showPreviousResults, this, [this, childId] {
181 emit showChildAlgorithmOutputs( childId );
182 } );
183 connect( item, &QgsModelChildAlgorithmGraphicItem::showLog, this, [this, childId] {
184 emit showChildAlgorithmLog( childId );
185 } );
186
187 addCommentItemForComponent( model, it.value(), item );
188 }
189
190 // arrows linking child algorithms
191 for ( auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
192 {
193 int topIdx = 0;
194 int bottomIdx = 0;
195 if ( !it.value().algorithm() )
196 continue;
197
198 const QgsProcessingParameterDefinitions parameters = it.value().algorithm()->parameterDefinitions();
199 for ( const QgsProcessingParameterDefinition *parameter : parameters )
200 {
201 if ( !( parameter->flags() & Qgis::ProcessingParameterFlag::Hidden ) )
202 {
203 QList<QgsProcessingModelChildParameterSource> sources;
204 if ( it.value().parameterSources().contains( parameter->name() ) )
205 sources = it.value().parameterSources()[parameter->name()];
206 for ( const QgsProcessingModelChildParameterSource &source : std::as_const( sources ) )
207 {
208 const QList<LinkSource> sourceItems = linkSourcesForParameterValue( model, QVariant::fromValue( source ), it.value().childId(), context );
209 for ( const LinkSource &link : sourceItems )
210 {
211 if ( !link.item )
212 continue;
213 QgsModelArrowItem *arrow = nullptr;
214 if ( link.linkIndex == -1 )
215 {
216 arrow = new QgsModelArrowItem( link.item, QgsModelArrowItem::Marker::NoMarker, mChildAlgorithmItems.value( it.value().childId() ), parameter->isDestination() ? Qt::BottomEdge : Qt::TopEdge, parameter->isDestination() ? bottomIdx : topIdx, QgsModelArrowItem::Marker::Circle );
217 }
218 else
219 {
220 arrow = new QgsModelArrowItem( link.item, link.edge, link.linkIndex, true, QgsModelArrowItem::Marker::NoMarker, mChildAlgorithmItems.value( it.value().childId() ), parameter->isDestination() ? Qt::BottomEdge : Qt::TopEdge, parameter->isDestination() ? bottomIdx : topIdx, true, QgsModelArrowItem::Marker::NoMarker );
221 }
222 addItem( arrow );
223 }
224 }
225 if ( parameter->isDestination() )
226 bottomIdx++;
227 else
228 topIdx++;
229 }
230 }
231 const QList<QgsProcessingModelChildDependency> dependencies = it.value().dependencies();
232 for ( const QgsProcessingModelChildDependency &depend : dependencies )
233 {
234 if ( depend.conditionalBranch.isEmpty() || !model->childAlgorithm( depend.childId ).algorithm() )
235 {
236 addItem( new QgsModelArrowItem( mChildAlgorithmItems.value( depend.childId ), QgsModelArrowItem::Marker::Circle, mChildAlgorithmItems.value( it.value().childId() ), QgsModelArrowItem::Marker::ArrowHead ) );
237 }
238 else
239 {
240 // find branch link point
241 const QgsProcessingOutputDefinitions outputs = model->childAlgorithm( depend.childId ).algorithm()->outputDefinitions();
242 int i = 0;
243 bool found = false;
244 for ( const QgsProcessingOutputDefinition *output : outputs )
245 {
246 if ( output->name() == depend.conditionalBranch )
247 {
248 found = true;
249 break;
250 }
251 i++;
252 }
253 if ( found )
254 addItem( new QgsModelArrowItem( mChildAlgorithmItems.value( depend.childId ), Qt::BottomEdge, i, QgsModelArrowItem::Marker::Circle, mChildAlgorithmItems.value( it.value().childId() ), QgsModelArrowItem::Marker::ArrowHead ) );
255 }
256 }
257 }
258
259 // and finally the model outputs
260 for ( auto it = childAlgs.constBegin(); it != childAlgs.constEnd(); ++it )
261 {
262 const QMap<QString, QgsProcessingModelOutput> outputs = it.value().modelOutputs();
263 QMap<QString, QgsModelComponentGraphicItem *> outputItems;
264
265 // offsets from algorithm item needed to correctly place output items
266 // which does not have valid position assigned (https://github.com/qgis/QGIS/issues/48132)
267 QgsProcessingModelComponent *algItem = mChildAlgorithmItems[it.value().childId()]->component();
268 const double outputOffsetX = algItem->size().width();
269 double outputOffsetY = 1.5 * algItem->size().height();
270
271 for ( auto outputIt = outputs.constBegin(); outputIt != outputs.constEnd(); ++outputIt )
272 {
273 QgsModelComponentGraphicItem *item = createOutputGraphicItem( model, outputIt.value().clone() );
274 addItem( item );
275 connect( item, &QgsModelComponentGraphicItem::requestModelRepaint, this, &QgsModelGraphicsScene::rebuildRequired );
276 connect( item, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged );
277 connect( item, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange );
278
279 // if output added not at the same time as algorithm then it does not have
280 // valid position and will be placed at (0,0). We need to calculate better position.
281 // See https://github.com/qgis/QGIS/issues/48132.
282 QPointF pos = outputIt.value().position();
283 if ( pos.isNull() )
284 {
285 pos = algItem->position() + QPointF( outputOffsetX, outputOffsetY );
286 outputOffsetY += 1.5 * outputIt.value().size().height();
287 }
288 int idx = -1;
289 int i = 0;
290 // find the actual index of the linked output from the child algorithm it comes from
291 if ( it.value().algorithm() )
292 {
293 const QgsProcessingOutputDefinitions sourceChildAlgOutputs = it.value().algorithm()->outputDefinitions();
294 for ( const QgsProcessingOutputDefinition *childAlgOutput : sourceChildAlgOutputs )
295 {
296 if ( childAlgOutput->name() == outputIt.value().childOutputName() )
297 {
298 idx = i;
299 break;
300 }
301 i++;
302 }
303 }
304
305 item->setPos( pos );
306 item->component()->setPosition( pos );
307 outputItems.insert( outputIt.key(), item );
308 addItem( new QgsModelArrowItem( mChildAlgorithmItems[it.value().childId()], Qt::BottomEdge, idx, QgsModelArrowItem::Marker::Circle, item, QgsModelArrowItem::Marker::Circle ) );
309
310 addCommentItemForComponent( model, outputIt.value(), item );
311 }
312 mOutputItems.insert( it.value().childId(), outputItems );
313 }
314}
315
316QList<QgsModelComponentGraphicItem *> QgsModelGraphicsScene::selectedComponentItems()
317{
318 QList<QgsModelComponentGraphicItem *> componentItemList;
319
320 const QList<QGraphicsItem *> graphicsItemList = selectedItems();
321 for ( QGraphicsItem *item : graphicsItemList )
322 {
323 if ( QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item ) )
324 {
325 componentItemList.push_back( componentItem );
326 }
327 }
328
329 return componentItemList;
330}
331
332QgsModelComponentGraphicItem *QgsModelGraphicsScene::componentItemAt( QPointF position ) const
333{
334 //get a list of items which intersect the specified position, in descending z order
335 const QList<QGraphicsItem *> itemList = items( position, Qt::IntersectsItemShape, Qt::DescendingOrder );
336
337 for ( QGraphicsItem *graphicsItem : itemList )
338 {
339 if ( QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( graphicsItem ) )
340 {
341 return componentItem;
342 }
343 }
344 return nullptr;
345}
346
347QgsModelComponentGraphicItem *QgsModelGraphicsScene::groupBoxItem( const QString &uuid )
348{
349 return mGroupBoxItems.value( uuid );
350}
351
352QgsModelChildAlgorithmGraphicItem *QgsModelGraphicsScene::childAlgorithmItem( const QString &childId )
353{
354 return mChildAlgorithmItems.value( childId );
355}
356
357QgsModelComponentGraphicItem *QgsModelGraphicsScene::parameterItem( const QString &name )
358{
359 return mParameterItems.value( name );
360}
361
362void QgsModelGraphicsScene::selectAll()
363{
364 //select all items in scene
365 QgsModelComponentGraphicItem *focusedItem = nullptr;
366 const QList<QGraphicsItem *> itemList = items();
367 for ( QGraphicsItem *graphicsItem : itemList )
368 {
369 if ( QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( graphicsItem ) )
370 {
371 componentItem->setSelected( true );
372 if ( !focusedItem )
373 focusedItem = componentItem;
374 }
375 }
376 emit selectedItemChanged( focusedItem );
377}
378
379void QgsModelGraphicsScene::deselectAll()
380{
381 //we can't use QGraphicsScene::clearSelection, as that emits no signals
382 //and we don't know which items are being deselected
383 //instead, do the clear selection manually...
384 const QList<QGraphicsItem *> selectedItemList = selectedItems();
385 for ( QGraphicsItem *item : selectedItemList )
386 {
387 if ( QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item ) )
388 {
389 componentItem->setSelected( false );
390 }
391 }
392 emit selectedItemChanged( nullptr );
393}
394
395void QgsModelGraphicsScene::setSelectedItem( QgsModelComponentGraphicItem *item )
396{
397 whileBlocking( this )->deselectAll();
398 if ( item )
399 {
400 item->setSelected( true );
401 }
402 emit selectedItemChanged( item );
403}
404
405void QgsModelGraphicsScene::setLastRunResult( const QgsProcessingModelResult &result )
406{
407 mLastResult = result;
408
409 const auto childResults = mLastResult.childResults();
410 for ( auto it = childResults.constBegin(); it != childResults.constEnd(); ++it )
411 {
412 if ( QgsModelChildAlgorithmGraphicItem *item = mChildAlgorithmItems.value( it.key() ) )
413 {
414 item->setResults( it.value() );
415 }
416 }
417}
418
419QList<QgsModelGraphicsScene::LinkSource> QgsModelGraphicsScene::linkSourcesForParameterValue( QgsProcessingModelAlgorithm *model, const QVariant &value, const QString &childId, QgsProcessingContext &context ) const
420{
421 QList<QgsModelGraphicsScene::LinkSource> res;
422 if ( value.userType() == QMetaType::Type::QVariantList )
423 {
424 const QVariantList list = value.toList();
425 for ( const QVariant &v : list )
426 res.append( linkSourcesForParameterValue( model, v, childId, context ) );
427 }
428 else if ( value.userType() == QMetaType::Type::QStringList )
429 {
430 const QStringList list = value.toStringList();
431 for ( const QString &v : list )
432 res.append( linkSourcesForParameterValue( model, v, childId, context ) );
433 }
434 else if ( value.userType() == qMetaTypeId<QgsProcessingModelChildParameterSource>() )
435 {
436 const QgsProcessingModelChildParameterSource source = value.value<QgsProcessingModelChildParameterSource>();
437 switch ( source.source() )
438 {
440 {
441 LinkSource l;
442 l.item = mParameterItems.value( source.parameterName() );
443 l.edge = Qt::BottomEdge;
444 l.linkIndex = 0;
445
446 res.append( l );
447 break;
448 }
450 {
451 if ( !model->childAlgorithm( source.outputChildId() ).algorithm() )
452 break;
453
454 const QgsProcessingOutputDefinitions outputs = model->childAlgorithm( source.outputChildId() ).algorithm()->outputDefinitions();
455 int i = 0;
456 for ( const QgsProcessingOutputDefinition *output : outputs )
457 {
458 if ( output->name() == source.outputName() )
459 break;
460 i++;
461 }
462 if ( mChildAlgorithmItems.contains( source.outputChildId() ) )
463 {
464 LinkSource l;
465 l.item = mChildAlgorithmItems.value( source.outputChildId() );
466 l.edge = Qt::BottomEdge;
467
468 // do sanity check of linked index
469 if ( i >= model->childAlgorithm( source.outputChildId() ).algorithm()->outputDefinitions().length() )
470 {
471 QString short_message = tr( "Check output links for alg: %1" ).arg( model->childAlgorithm( source.outputChildId() ).algorithm()->name() );
472 QString long_message = tr( "Cannot link output for alg: %1" ).arg( model->childAlgorithm( source.outputChildId() ).algorithm()->name() );
473 QString title( tr( "Algorithm link error" ) );
474 if ( messageBar() )
475 showWarning( const_cast<QString &>( short_message ), const_cast<QString &>( title ), const_cast<QString &>( long_message ) );
476 else
477 QgsMessageLog::logMessage( long_message, "QgsModelGraphicsScene", Qgis::MessageLevel::Warning, true );
478 break;
479 }
480
481 l.linkIndex = i;
482 res.append( l );
483 }
484
485 break;
486 }
487
489 {
490 const QMap<QString, QgsProcessingModelAlgorithm::VariableDefinition> variables = model->variablesForChildAlgorithm( childId, &context );
491 const QgsExpression exp( source.expression() );
492 const QSet<QString> vars = exp.referencedVariables();
493 for ( const QString &v : vars )
494 {
495 if ( variables.contains( v ) )
496 {
497 res.append( linkSourcesForParameterValue( model, QVariant::fromValue( variables.value( v ).source ), childId, context ) );
498 }
499 }
500 break;
501 }
502
506 break;
507 }
508 }
509 return res;
510}
511
512void QgsModelGraphicsScene::addCommentItemForComponent( QgsProcessingModelAlgorithm *model, const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem )
513{
514 if ( mFlags & FlagHideComments || !component.comment() || component.comment()->description().isEmpty() )
515 return;
516
517 QgsModelComponentGraphicItem *commentItem = createCommentGraphicItem( model, component.comment()->clone(), parentItem );
518 commentItem->setPos( component.comment()->position().x(), component.comment()->position().y() );
519 addItem( commentItem );
520 connect( commentItem, &QgsModelComponentGraphicItem::requestModelRepaint, this, &QgsModelGraphicsScene::rebuildRequired );
521 connect( commentItem, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged );
522 connect( commentItem, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange );
523
524 auto arrow = std::make_unique<QgsModelArrowItem>( parentItem, QgsModelArrowItem::Circle, commentItem, QgsModelArrowItem::Circle );
525 arrow->setPenStyle( Qt::DotLine );
526 addItem( arrow.release() );
527}
528
529QgsMessageBar *QgsModelGraphicsScene::messageBar() const
530{
531 return mMessageBar;
532}
533
534void QgsModelGraphicsScene::setMessageBar( QgsMessageBar *messageBar )
535{
536 mMessageBar = messageBar;
537}
538
539void QgsModelGraphicsScene::showWarning( const QString &shortMessage, const QString &title, const QString &longMessage, Qgis::MessageLevel level ) const
540{
541 QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
542 QPushButton *detailsButton = new QPushButton( tr( "Details" ) );
543 connect( detailsButton, &QPushButton::clicked, detailsButton, [detailsButton, title, longMessage] {
544 QgsMessageViewer *dialog = new QgsMessageViewer( detailsButton );
545 dialog->setTitle( title );
546 dialog->setMessage( longMessage, QgsMessageOutput::MessageHtml );
547 dialog->showMessage();
548 } );
549 messageWidget->layout()->addWidget( detailsButton );
550 mMessageBar->clearWidgets();
551 mMessageBar->pushWidget( messageWidget, level, 0 );
552}
553
554void QgsModelGraphicsScene::requestRebuildRequired()
555{
556 emit rebuildRequired();
557}
558
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:156
@ Warning
Warning message.
Definition qgis.h:158
@ ExpressionText
Parameter value is taken from a text with expressions, evaluated just before the algorithm runs.
Definition qgis.h:3852
@ ModelOutput
Parameter value is linked to an output parameter for the model.
Definition qgis.h:3853
@ ChildOutput
Parameter value is taken from an output generated by a child algorithm.
Definition qgis.h:3849
@ ModelParameter
Parameter value is taken from a parent model parameter.
Definition qgis.h:3848
@ StaticValue
Parameter value is a static value.
Definition qgis.h:3850
@ Expression
Parameter value is taken from an expression, evaluated just before the algorithm runs.
Definition qgis.h:3851
@ Hidden
Parameter is hidden and should not be shown to users.
Definition qgis.h:3764
Handles parsing and evaluation of expressions (formerly called "search strings").
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())
Adds a message to the log instance (and creates it if necessary).
A generic message view for displaying QGIS messages.
void setTitle(const QString &title) override
Sets title for the messages.
void setMessage(const QString &message, MessageType msgType) override
Sets message, it won't be displayed until.
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 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.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:6511
QList< const QgsProcessingOutputDefinition * > QgsProcessingOutputDefinitions
List of processing parameters.
QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions
List of processing parameters.