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
63 FlagHideControls = 1 << 1,
64 FlagHideComments = 1 << 2,
66 Q_DECLARE_FLAGS( Flags, Flag )
73 QgsProcessingModelAlgorithm *model();
75 void setModel( QgsProcessingModelAlgorithm *model );
82 void setFlags( QgsModelGraphicsScene::Flags flags ) { mFlags = flags; }
90 void setFlag( QgsModelGraphicsScene::Flag flag,
bool on =
true );
97 QgsModelGraphicsScene::Flags flags()
const {
return mFlags; }
99 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
109 QList<QgsModelComponentGraphicItem *> selectedComponentItems();
114 QgsModelComponentGraphicItem *componentItemAt( QPointF position )
const;
119 QgsModelComponentGraphicItem *groupBoxItem(
const QString &uuid );
137 void setSelectedItem( QgsModelComponentGraphicItem *item );
168 void rebuildRequired();
176 void componentAboutToChange(
const QString &text,
int id = 0 );
181 void componentChanged();
187 void selectedItemChanged( QgsModelComponentGraphicItem *selected );
201 void runFromChild(
const QString &childId );
208 void showChildAlgorithmOutputs(
const QString &childId );
215 void showChildAlgorithmLog(
const QString &childId );
221 virtual QgsModelComponentGraphicItem *createParameterGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelParameter *param )
const SIP_FACTORY;
226 virtual QgsModelChildAlgorithmGraphicItem *createChildAlgGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelChildAlgorithm *child )
const SIP_FACTORY;
231 virtual QgsModelComponentGraphicItem *createOutputGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelOutput *output )
const SIP_FACTORY;
236 virtual QgsModelComponentGraphicItem *createCommentGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelComment *comment, QgsModelComponentGraphicItem *parentItem )
const SIP_FACTORY;
241 QgsModelComponentGraphicItem *createGroupBoxGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelGroupBox *box )
const SIP_FACTORY;
246 QgsModelComponentGraphicItem *item =
nullptr;
247 Qt::Edge edge = Qt::LeftEdge;
250 QList<LinkSource> linkSourcesForParameterValue( QgsProcessingModelAlgorithm *model,
const QVariant &value,
const QString &childId,
QgsProcessingContext &context )
const;
252 void addCommentItemForComponent( QgsProcessingModelAlgorithm *model,
const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem );
254 Flags mFlags = Flags();
256 QgsProcessingModelAlgorithm *mModel =
nullptr;
258 QMap<QString, QgsModelComponentGraphicItem *> mParameterItems;
259 QMap<QString, QgsModelChildAlgorithmGraphicItem *> mChildAlgorithmItems;
260 QMap<QString, QMap<QString, QgsModelComponentGraphicItem *>> mOutputItems;
261 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)