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 );
143 void setChildAlgorithmResults(
const QVariantMap &results );
148 void setChildAlgorithmInputs(
const QVariantMap &inputs );
167 void showWarning(
const QString &shortMessage,
const QString &title,
const QString &longMessage,
Qgis::MessageLevel level = Qgis::MessageLevel::Warning )
const;
174 void rebuildRequired();
182 void componentAboutToChange(
const QString &text,
int id = 0 );
187 void componentChanged();
193 void selectedItemChanged( QgsModelComponentGraphicItem *selected );
200 virtual QgsModelComponentGraphicItem *createParameterGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelParameter *param )
const SIP_FACTORY;
205 virtual QgsModelChildAlgorithmGraphicItem *createChildAlgGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelChildAlgorithm *child )
const SIP_FACTORY;
210 virtual QgsModelComponentGraphicItem *createOutputGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelOutput *output )
const SIP_FACTORY;
215 virtual QgsModelComponentGraphicItem *createCommentGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelComment *comment,
216 QgsModelComponentGraphicItem *parentItem )
const SIP_FACTORY;
221 QgsModelComponentGraphicItem *createGroupBoxGraphicItem( QgsProcessingModelAlgorithm *model, QgsProcessingModelGroupBox *box )
const SIP_FACTORY;
227 QgsModelComponentGraphicItem *item =
nullptr;
228 Qt::Edge edge = Qt::LeftEdge;
231 QList< LinkSource > linkSourcesForParameterValue( QgsProcessingModelAlgorithm *model,
const QVariant &value,
const QString &childId,
QgsProcessingContext &context )
const;
233 void addCommentItemForComponent( QgsProcessingModelAlgorithm *model,
const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem );
235 Flags mFlags = Flags();
237 QgsProcessingModelAlgorithm *mModel =
nullptr;
239 QMap< QString, QgsModelComponentGraphicItem * > mParameterItems;
240 QMap< QString, QgsModelChildAlgorithmGraphicItem * > mChildAlgorithmItems;
241 QMap< QString, QMap< QString, QgsModelComponentGraphicItem * > > mOutputItems;
242 QMap< QString, QgsModelComponentGraphicItem * > mGroupBoxItems;
243 QVariantMap mChildResults;
244 QVariantMap mChildInputs;
MessageLevel
Level for messages This will be used both for message log and message bar in application.
A bar for displaying non-blocking messages to the user.
Contains information about the context in which a processing algorithm is executed.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)