QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QgsProcessingHiddenWidgetWrapper Class Reference

An widget wrapper for hidden widgets. More...

#include <qgsprocessingwidgetwrapper.h>

Inheritance diagram for QgsProcessingHiddenWidgetWrapper:
Inheritance graph
[legend]

Public Member Functions

 QgsProcessingHiddenWidgetWrapper (const QgsProcessingParameterDefinition *parameter=nullptr, QgsProcessingGui::WidgetType type=QgsProcessingGui::Standard, QObject *parent=nullptr)
 Constructor for QgsProcessingHiddenWidgetWrapper, for the specified parameter definition and dialog type.
 
const QgsVectorLayerlinkedVectorLayer () const override
 Returns the optional vector layer associated with this widget wrapper, or nullptr if no vector layer is applicable.
 
void setLinkedVectorLayer (const QgsVectorLayer *layer)
 Sets the vector layer linked to the wrapper.
 
void setWidgetValue (const QVariant &value, QgsProcessingContext &context) override
 Sets the current value for the parameter to show in the widget.
 
QVariant widgetValue () const override
 Returns the current value of the parameter.
 
- Public Member Functions inherited from QgsAbstractProcessingParameterWidgetWrapper
 QgsAbstractProcessingParameterWidgetWrapper (const QgsProcessingParameterDefinition *parameter=nullptr, QgsProcessingGui::WidgetType type=QgsProcessingGui::Standard, QObject *parent=nullptr)
 Constructor for QgsAbstractProcessingParameterWidgetWrapper, for the specified parameter definition and dialog type.
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context.
 
QLabel * createWrappedLabel ()
 Creates and returns a new label to accompany widgets created by the wrapper.
 
QWidget * createWrappedWidget (QgsProcessingContext &context)
 Creates and return a new wrapped widget which allows customization of the parameter's value.
 
virtual QVariantMap customProperties () const
 Returns any custom properties set by the wrapper.
 
const QgsProcessingParameterDefinitionparameterDefinition () const
 Returns the parameter definition associated with this wrapper.
 
QVariant parameterValue () const
 Returns the current value of the parameter.
 
virtual void postInitialize (const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers)
 Called after all wrappers have been created within a particular dialog or context, allowing the wrapper to connect to the wrappers of other, related parameters.
 
virtual void registerProcessingContextGenerator (QgsProcessingContextGenerator *generator)
 Registers a Processing context generator class that will be used to retrieve a Processing context for the wrapper when required.
 
void registerProcessingParametersGenerator (QgsProcessingParametersGenerator *generator)
 Registers a Processing parameters generator class that will be used to retrieve algorithm parameters for the wrapper when required (e.g.
 
virtual void setDialog (QDialog *dialog)
 Sets the parent dialog in which the wrapper is shown.
 
void setParameterValue (const QVariant &value, QgsProcessingContext &context)
 Sets the current value for the parameter.
 
virtual void setWidgetContext (const QgsProcessingParameterWidgetContext &context)
 Sets the context in which the Processing parameter widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.
 
virtual int stretch () const
 Returns the Qt layout "stretch" factor to use when adding this widget to a layout.
 
QgsProcessingGui::WidgetType type () const
 Returns the dialog type for which widgets and labels will be created by this wrapper.
 
const QgsProcessingParameterWidgetContextwidgetContext () const
 Returns the context in which the Processing parameter widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.
 
QLabel * wrappedLabel ()
 Returns the current wrapped label, if any.
 
QWidget * wrappedWidget ()
 Returns the current wrapped widget, if any.
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 

Protected Member Functions

QLabel * createLabel () override
 Creates a new label to accompany widgets created by the wrapper.
 
QWidget * createWidget () override
 Creates a new widget which allows customization of the parameter's value.
 

Additional Inherited Members

- Signals inherited from QgsAbstractProcessingParameterWidgetWrapper
void widgetValueHasChanged (QgsAbstractProcessingParameterWidgetWrapper *wrapper)
 Emitted whenever the parameter value (as defined by the wrapped widget) is changed.
 
- Protected Attributes inherited from QgsAbstractProcessingParameterWidgetWrapper
QgsProcessingParametersGeneratormParametersGenerator = nullptr
 
QgsProcessingContextGeneratormProcessingContextGenerator = nullptr
 
QgsProcessingParameterWidgetContext mWidgetContext
 

Detailed Description

An widget wrapper for hidden widgets.

The hidden widget wrapper allows for creation of a widget wrapper which does not provide a graphical widget, yet still implements the QgsAbstractProcessingParameterWidgetWrapper interface.

Since
QGIS 3.14

Definition at line 682 of file qgsprocessingwidgetwrapper.h.

Constructor & Destructor Documentation

◆ QgsProcessingHiddenWidgetWrapper()

QgsProcessingHiddenWidgetWrapper::QgsProcessingHiddenWidgetWrapper ( const QgsProcessingParameterDefinition parameter = nullptr,
QgsProcessingGui::WidgetType  type = QgsProcessingGui::Standard,
QObject *  parent = nullptr 
)

Constructor for QgsProcessingHiddenWidgetWrapper, for the specified parameter definition and dialog type.

Definition at line 458 of file qgsprocessingwidgetwrapper.cpp.

Member Function Documentation

◆ createLabel()

QLabel * QgsProcessingHiddenWidgetWrapper::createLabel ( )
overrideprotectedvirtual

Creates a new label to accompany widgets created by the wrapper.

The caller takes ownership of the returned label. Some parameter type and dialog type combinations will return nullptr for this method. If NULLPTR is returned, then no label should be shown for the parameter's widget (i.e. the label is embedded inside the widget itself).

See also
createWidget()

Reimplemented from QgsAbstractProcessingParameterWidgetWrapper.

Definition at line 494 of file qgsprocessingwidgetwrapper.cpp.

◆ createWidget()

QWidget * QgsProcessingHiddenWidgetWrapper::createWidget ( )
overrideprotectedvirtual

Creates a new widget which allows customization of the parameter's value.

The caller takes ownership of the returned widget.

See also
createLabel()

Implements QgsAbstractProcessingParameterWidgetWrapper.

Definition at line 488 of file qgsprocessingwidgetwrapper.cpp.

◆ linkedVectorLayer()

const QgsVectorLayer * QgsProcessingHiddenWidgetWrapper::linkedVectorLayer ( ) const
overridevirtual

Returns the optional vector layer associated with this widget wrapper, or nullptr if no vector layer is applicable.

This is used to correctly generate expression contexts within the GUI, e.g. to allow expression buttons and property override buttons to correctly show the appropriate vector layer fields.

Since
QGIS 3.6

Reimplemented from QgsAbstractProcessingParameterWidgetWrapper.

Definition at line 478 of file qgsprocessingwidgetwrapper.cpp.

◆ setLinkedVectorLayer()

void QgsProcessingHiddenWidgetWrapper::setLinkedVectorLayer ( const QgsVectorLayer layer)

Sets the vector layer linked to the wrapper.

Definition at line 483 of file qgsprocessingwidgetwrapper.cpp.

◆ setWidgetValue()

void QgsProcessingHiddenWidgetWrapper::setWidgetValue ( const QVariant &  value,
QgsProcessingContext context 
)
overridevirtual

Sets the current value for the parameter to show in the widget.

The context argument is used to specify the wider Processing context which the current value is associated with.

See also
widgetValue()

Implements QgsAbstractProcessingParameterWidgetWrapper.

Definition at line 464 of file qgsprocessingwidgetwrapper.cpp.

◆ widgetValue()

QVariant QgsProcessingHiddenWidgetWrapper::widgetValue ( ) const
overridevirtual

Returns the current value of the parameter.

See also
setWidgetValue()

Implements QgsAbstractProcessingParameterWidgetWrapper.

Definition at line 473 of file qgsprocessingwidgetwrapper.cpp.


The documentation for this class was generated from the following files: