QGIS API Documentation 4.3.0-Master (4a47d6a9bb1)
Loading...
Searching...
No Matches
qgsprocessingwidgetcontext.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingwidgetcontext.cpp
3 ---------------------
4 begin : August 2026
5 copyright : (C) 2026 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18
20
21#include "qgsbrowserguimodel.h"
22#include "qgsmapcanvas.h"
23#include "qgsmaplayer.h"
24#include "qgsmessagebar.h"
26#include "qgsproject.h"
27
28//
29// QgsProcessingParameterWidgetContext
30//
31
33{
34 mMapCanvas = canvas;
35}
36
38{
39 return mMapCanvas;
40}
41
43{
44 mMessageBar = bar;
45}
46
48{
49 return mMessageBar;
50}
51
56
61
66
68{
69 return mProject;
70}
71
73{
74 return mModelChildAlgorithmId;
75}
76
81
83{
84 return mActiveLayer;
85}
86
91
93{
94 mProcessingContextGenerator = generator;
95}
96
101
103{
104 return mModelDialog;
105}
106
108{
109 mModelDialog = dialog;
110}
111
112QgsProcessingModelAlgorithm *QgsProcessingParameterWidgetContext::model() const
113{
114 return mModel;
115}
116
117void QgsProcessingParameterWidgetContext::setModel( QgsProcessingModelAlgorithm *model )
118{
119 mModel = model;
120}
A model for showing available data sources and other items in a structured tree.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:83
A bar for displaying non-blocking messages to the user.
An interface for objects which can create Processing contexts.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QgsProject * project() const
Returns the project associated with the widget.
QgsBrowserGuiModel * browserModel() const
Returns the browser model associated with the widget.
void setActiveLayer(QgsMapLayer *layer)
Sets the current active layer.
QgsModelDesignerDialog * modelDesignerDialog() const
Returns the associated model designer dialog, if applicable.
void setModelChildAlgorithmId(const QString &id)
Sets the child algorithm id within the model which the parameter widget is associated with.
void setProject(QgsProject *project)
Sets the project associated with the widget.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
void setBrowserModel(QgsBrowserGuiModel *model)
Sets the browser model associated with the widget.
QgsProcessingModelAlgorithm * model() const
Returns the model which the parameter widget is associated with.
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
QgsMapLayer * activeLayer() const
Returns the current active layer.
void setModelDesignerDialog(QgsModelDesignerDialog *dialog)
Sets the associated model designer dialog, if applicable.
void setModel(QgsProcessingModelAlgorithm *model)
Sets the model which the parameter widget is associated with.
QgsProcessingContextGenerator * processingContextGenerator()
Returns the Processing context generator class that will be used to retrieve a Processing context for...
void registerProcessingContextGenerator(QgsProcessingContextGenerator *generator)
Registers a Processing context generator class that will be used to retrieve a Processing context for...
QString modelChildAlgorithmId() const
Returns the child algorithm ID within the model which the parameter widget is associated with.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114