16#ifndef QGSMODELGRAPHICSCENE_H
17#define QGSMODELGRAPHICSCENE_H
22#include <QGraphicsScene>
24class QgsProcessingModelAlgorithm;
25class QgsModelComponentGraphicItem;
26class QgsProcessingModelParameter;
27class QgsProcessingModelChildAlgorithm;
28class QgsProcessingModelOutput;
29class QgsProcessingModelComponent;
30class QgsProcessingModelComment;
31class QgsModelChildAlgorithmGraphicItem;
32class QgsProcessingModelGroupBox;
43class GUI_EXPORT QgsModelGraphicsScene :
public QGraphicsScene
64 FlagHideControls = 1 << 1,
65 FlagHideComments = 1 << 2,
67 Q_DECLARE_FLAGS( Flags, Flag )
74 QgsProcessingModelAlgorithm *model();
76 void setModel( QgsProcessingModelAlgorithm *model );
83 void setFlags( QgsModelGraphicsScene::Flags flags ) { mFlags = flags; }
91 void setFlag( QgsModelGraphicsScene::Flag flag,
bool on =
true );
98 QgsModelGraphicsScene::Flags flags()
const {
return mFlags; }
100 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
110 QList<QgsModelComponentGraphicItem *> selectedComponentItems();
115 QgsModelComponentGraphicItem *componentItemAt( QPointF position )
const;
120 QgsModelComponentGraphicItem *groupBoxItem(
const QString &uuid );
138 void setSelectedItem( QgsModelComponentGraphicItem *item );
169 void rebuildRequired();
177 void componentAboutToChange(
const QString &text,
int id = 0 );
182 void componentChanged();
188 void selectedItemChanged( QgsModelComponentGraphicItem *selected );
202 void runFromChild(
const QString &childId );
209 void showChildAlgorithmOutputs(
const QString &childId );
216 void showChildAlgorithmLog(
const QString &childId );
223 virtual QgsModelComponentGraphicItem *createParameterGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelParameter *param )
const SIP_FACTORY;
228 virtual QgsModelChildAlgorithmGraphicItem *createChildAlgGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelChildAlgorithm *child )
const SIP_FACTORY;
233 virtual QgsModelComponentGraphicItem *createOutputGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelOutput *output )
const SIP_FACTORY;
238 virtual QgsModelComponentGraphicItem *createCommentGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelComment *comment,
239 QgsModelComponentGraphicItem *parentItem )
const SIP_FACTORY;
244 QgsModelComponentGraphicItem *createGroupBoxGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelGroupBox *box )
const SIP_FACTORY;
250 QgsModelComponentGraphicItem *item =
nullptr;
251 Qt::Edge edge = Qt::LeftEdge;
254 QList< LinkSource > linkSourcesForParameterValue( QgsProcessingModelAlgorithm *model,
const QVariant &value,
const QString &childId,
QgsProcessingContext &context )
const;
256 void addCommentItemForComponent( QgsProcessingModelAlgorithm *model,
const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem );
258 Flags mFlags = Flags();
260 QgsProcessingModelAlgorithm *mModel =
nullptr;
262 QMap< QString, QgsModelComponentGraphicItem * > mParameterItems;
263 QMap< QString, QgsModelChildAlgorithmGraphicItem * > mChildAlgorithmItems;
264 QMap< QString, QMap< QString, QgsModelComponentGraphicItem * > > mOutputItems;
265 QMap< QString, QgsModelComponentGraphicItem * > mGroupBoxItems;
MessageLevel
Level for messages This will be used both for message log and message bar in application.
@ Warning
Warning message.
A bar for displaying non-blocking messages to the user.
Contains information about the context in which a processing algorithm is executed.
Encapsulates the results of running a Processing model.
#define SIP_ENUM_BASETYPE(type)
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)