Metadata and modeller exposure support

This commit is contained in:
Matthias Kuhn 2018-03-03 11:16:13 -05:00 committed by Nyall Dawson
parent ff7b831b9d
commit 2145865a42
5 changed files with 36 additions and 2 deletions

View File

@ -43,6 +43,18 @@ This will be used in comboboxes and list widgets.
virtual QString id() const = 0;
%Docstring
A static id for this type which will be used for storing this parameter type.
%End
virtual bool exposeToModeller() const;
%Docstring
Determines if this parameter is available in the modeller.
The default implementation returns true.
%End
virtual QVariantMap metadata() const;
%Docstring
Metadata for this parameter type. Can be used for example to define custom widgets.
The default implementation returns an empty map.
%End
};

View File

@ -105,7 +105,7 @@ SET(QGIS_CORE_SRCS
processing/qgsprocessingfeedback.cpp
processing/qgsprocessingoutputs.cpp
processing/qgsprocessingparameters.cpp
processing/qgsprocessingparametertypeimpl.cpp
processing/qgsprocessingparametertype.cpp
processing/qgsprocessingprovider.cpp
processing/qgsprocessingregistry.cpp
processing/qgsprocessingutils.cpp

View File

@ -0,0 +1,11 @@
#include "qgsprocessingparametertype.h"
bool QgsProcessingParameterType::exposeToModeller() const
{
return true;
}
QVariantMap QgsProcessingParameterType::metadata() const
{
return QVariantMap();
}

View File

@ -42,6 +42,18 @@ class CORE_EXPORT QgsProcessingParameterType
* A static id for this type which will be used for storing this parameter type.
*/
virtual QString id() const = 0;
/**
* Determines if this parameter is available in the modeller.
* The default implementation returns true.
*/
virtual bool exposeToModeller() const;
/**
* Metadata for this parameter type. Can be used for example to define custom widgets.
* The default implementation returns an empty map.
*/
virtual QVariantMap metadata() const;
};
#endif // QGSPROCESSINGPARAMETERTYPE_H

View File

@ -1 +0,0 @@
#include "qgsprocessingparametertypeimpl.h"