mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-03 00:04:47 -04:00
Compare commits
49 Commits
e158ebb876
...
74c66877f7
Author | SHA1 | Date | |
---|---|---|---|
|
74c66877f7 | ||
|
4bab898301 | ||
|
eca451bf4a | ||
|
e6efa0a5c6 | ||
|
0ae2327be1 | ||
|
64bef5c290 | ||
|
e30a729a28 | ||
|
40b7b18358 | ||
|
b1fcfad0fa | ||
|
939fcf9ea2 | ||
|
16cdae82ce | ||
|
2743ea2fa7 | ||
|
93dd35920a | ||
|
3f5c2a7a1b | ||
|
9c1035e773 | ||
|
293be69903 | ||
|
8bd12426d7 | ||
|
17b26806d6 | ||
|
b29f446c7c | ||
|
76ac2f916b | ||
|
7ba380c851 | ||
|
9670c98118 | ||
|
5b7c964178 | ||
|
8a8c0f4501 | ||
|
a44563fd4d | ||
|
5a121ceb95 | ||
|
620db939b8 | ||
|
0f54c08f4c | ||
|
4ebabb5ba6 | ||
|
cce86d7cff | ||
|
0e1e1505eb | ||
|
f84c4ff43b | ||
|
1af32010e8 | ||
|
1f622fb9b5 | ||
|
287fc1b0f2 | ||
|
46ebf8dff2 | ||
|
1dda85e367 | ||
|
f36e86ff5d | ||
|
c4b0d73b7d | ||
|
9bacaee3c6 | ||
|
545e264c70 | ||
|
9b95398cdb | ||
|
2fe7c92204 | ||
|
19e318fb1b | ||
|
12c1264293 | ||
|
9b45dedeb7 | ||
|
a7b079752a | ||
|
192298a388 | ||
|
99613254d1 |
@ -1,19 +1,19 @@
|
|||||||
# The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h
|
# The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName)
|
QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName)
|
||||||
QgsProcessingOutputMapLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputMapLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputMapLayer.__group__ = ['processing']
|
QgsProcessingOutputMapLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
||||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
||||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -25,13 +25,13 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
||||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'modelColor', 'valueAsString']
|
||||||
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
||||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputHtml.__group__ = ['processing']
|
QgsProcessingOutputHtml.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -43,31 +43,31 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
||||||
QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputNumber.__overridden_methods__ = ['modelColor', 'type', 'valueAsString']
|
||||||
QgsProcessingOutputNumber.__group__ = ['processing']
|
QgsProcessingOutputNumber.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
||||||
QgsProcessingOutputString.__overridden_methods__ = ['type']
|
QgsProcessingOutputString.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputString.__group__ = ['processing']
|
QgsProcessingOutputString.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
||||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputBoolean.__overridden_methods__ = ['modelColor', 'type', 'valueAsString']
|
||||||
QgsProcessingOutputBoolean.__group__ = ['processing']
|
QgsProcessingOutputBoolean.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
||||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputFolder.__group__ = ['processing']
|
QgsProcessingOutputFolder.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
||||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputFile.__group__ = ['processing']
|
QgsProcessingOutputFile.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -79,12 +79,12 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
||||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputDefinition.__virtual_methods__ = ['valueAsString', 'valueAsFormattedString']
|
QgsProcessingOutputDefinition.__virtual_methods__ = ['modelColor', 'valueAsString', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputDefinition.__abstract_methods__ = ['type']
|
QgsProcessingOutputDefinition.__abstract_methods__ = ['type']
|
||||||
QgsProcessingOutputDefinition.__group__ = ['processing']
|
QgsProcessingOutputDefinition.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -82,7 +82,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
||||||
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
||||||
QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||||
QgsProcessingParameterCrs.__group__ = ['processing']
|
QgsProcessingParameterCrs.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -103,7 +103,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName)
|
QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName)
|
||||||
QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode)
|
QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode)
|
||||||
QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterGeometry.__group__ = ['processing']
|
QgsProcessingParameterGeometry.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -137,25 +137,25 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
||||||
QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||||
QgsProcessingParameterDistance.__group__ = ['processing']
|
QgsProcessingParameterDistance.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName)
|
QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName)
|
||||||
QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterArea.__group__ = ['processing']
|
QgsProcessingParameterArea.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName)
|
QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName)
|
||||||
QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterVolume.__group__ = ['processing']
|
QgsProcessingParameterVolume.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName)
|
QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName)
|
||||||
QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterDuration.__group__ = ['processing']
|
QgsProcessingParameterDuration.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -183,7 +183,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
||||||
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
||||||
QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterEnum.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||||
QgsProcessingParameterEnum.__group__ = ['processing']
|
QgsProcessingParameterEnum.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -326,7 +326,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName)
|
QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName)
|
||||||
QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode)
|
QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode)
|
||||||
QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterDateTime.__group__ = ['processing']
|
QgsProcessingParameterDateTime.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -389,7 +389,7 @@ try:
|
|||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDefinition.__virtual_methods__ = ['isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip']
|
QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'userFriendlyString', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip']
|
||||||
QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type']
|
QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type']
|
||||||
QgsProcessingParameterDefinition.__group__ = ['processing']
|
QgsProcessingParameterDefinition.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h
|
# The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes']
|
QgsProcessingParameterType.defaultModelColor = staticmethod(QgsProcessingParameterType.defaultModelColor)
|
||||||
|
QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes', 'modelColor']
|
||||||
QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes']
|
QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes']
|
||||||
QgsProcessingParameterType.__group__ = ['processing']
|
QgsProcessingParameterType.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -65,6 +65,13 @@ Constructor for QgsProcessingOutputDefinition.
|
|||||||
|
|
||||||
virtual ~QgsProcessingOutputDefinition();
|
virtual ~QgsProcessingOutputDefinition();
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the output in model designer windows.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QString type() const = 0;
|
virtual QString type() const = 0;
|
||||||
%Docstring
|
%Docstring
|
||||||
Unique output type name.
|
Unique output type name.
|
||||||
@ -189,6 +196,9 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or
|
|||||||
Constructor for QgsProcessingOutputMapLayer.
|
Constructor for QgsProcessingOutputMapLayer.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -215,6 +225,9 @@ A vector layer output for processing algorithms.
|
|||||||
Constructor for QgsProcessingOutputVectorLayer.
|
Constructor for QgsProcessingOutputVectorLayer.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -257,6 +270,9 @@ Constructor for QgsProcessingOutputRasterLayer.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -316,8 +332,10 @@ Returns the type name for the output class.
|
|||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -342,6 +360,9 @@ Constructor for QgsProcessingOutputHtml.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -370,6 +391,7 @@ Constructor for QgsProcessingOutputVariant.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
@ -393,6 +415,9 @@ A numeric output for processing algorithms.
|
|||||||
Constructor for QgsProcessingOutputNumber.
|
Constructor for QgsProcessingOutputNumber.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -423,6 +448,9 @@ Constructor for QgsProcessingOutputString.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -444,6 +472,9 @@ A boolean output for processing algorithms.
|
|||||||
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -475,8 +506,10 @@ Constructor for QgsProcessingOutputFolder.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -501,8 +534,10 @@ Constructor for QgsProcessingOutputFile.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -554,6 +589,9 @@ Constructor for QgsProcessingOutputVectorTileLayer.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -438,6 +438,27 @@ Constructor for QgsProcessingParameterDefinition.
|
|||||||
|
|
||||||
virtual ~QgsProcessingParameterDefinition();
|
virtual ~QgsProcessingParameterDefinition();
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the parameter in model designer windows.
|
||||||
|
|
||||||
|
The default implementation retrieves the color from the parameter type,
|
||||||
|
see :py:func:`QgsProcessingParameterType.modelColor()`.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
%Docstring
|
||||||
|
Returns a user-friendly string representation of the provided parameter
|
||||||
|
``value``.
|
||||||
|
|
||||||
|
The returned string is to be used for display purposes only, and should
|
||||||
|
be translated as required.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
Creates a clone of the parameter definition.
|
Creates a clone of the parameter definition.
|
||||||
@ -1994,6 +2015,9 @@ A coordinate reference system parameter for processing algorithms.
|
|||||||
Constructor for QgsProcessingParameterCrs.
|
Constructor for QgsProcessingParameterCrs.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
@ -2167,6 +2191,7 @@ Sets the allow multipart geometries
|
|||||||
.. seealso:: :py:func:`allowMultipart`
|
.. seealso:: :py:func:`allowMultipart`
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||||
@ -2316,6 +2341,7 @@ Constructor for QgsProcessingParameterMatrix.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -2512,6 +2538,7 @@ Constructor for QgsProcessingParameterNumber.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -2620,6 +2647,9 @@ Constructor for QgsProcessingParameterDistance.
|
|||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
||||||
|
|
||||||
|
|
||||||
@ -2758,6 +2788,8 @@ Sets the default area ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2848,6 +2880,8 @@ Sets the default volume ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2907,6 +2941,8 @@ Sets the default duration ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2977,6 +3013,7 @@ Constructor for QgsProcessingParameterRange.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -3106,6 +3143,9 @@ values.
|
|||||||
Constructor for QgsProcessingParameterEnum.
|
Constructor for QgsProcessingParameterEnum.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
@ -4523,6 +4563,7 @@ varying color opacity.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -4861,6 +4902,8 @@ Sets the acceptable data ``type`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
|
@ -23,6 +23,13 @@ Makes metadata of processing parameters available.
|
|||||||
%End
|
%End
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static QColor defaultModelColor();
|
||||||
|
%Docstring
|
||||||
|
Returns the default color for a processing parameter.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
|
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
Creates a new parameter of this type.
|
Creates a new parameter of this type.
|
||||||
@ -175,6 +182,16 @@ for the parameter.
|
|||||||
.. seealso:: :py:func:`acceptedOutputTypes`
|
.. seealso:: :py:func:`acceptedOutputTypes`
|
||||||
|
|
||||||
.. versionadded:: 3.44
|
.. versionadded:: 3.44
|
||||||
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the parameter in model designer windows.
|
||||||
|
|
||||||
|
The default implementation returns
|
||||||
|
:py:func:`~QgsProcessingParameterType.defaultModelColor`.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
%End
|
%End
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -16,7 +16,7 @@ QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag
|
|||||||
QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2))
|
QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2))
|
||||||
try:
|
try:
|
||||||
QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"}
|
QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"}
|
||||||
QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap']
|
QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkedParameterDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap']
|
||||||
QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition']
|
QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition']
|
||||||
QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint']
|
QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint']
|
||||||
QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']}
|
QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']}
|
||||||
@ -30,7 +30,7 @@ try:
|
|||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent']
|
QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'linkedParameterDataType', 'linkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent']
|
||||||
QgsModelParameterGraphicItem.__group__ = ['processing', 'models']
|
QgsModelParameterGraphicItem.__group__ = ['processing', 'models']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
@ -112,6 +112,8 @@ Shows a preview of moving the item from its stored position by ``dx``,
|
|||||||
Sets a new scene ``rect`` for the item.
|
Sets a new scene ``rect`` for the item.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event );
|
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event );
|
||||||
|
|
||||||
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event );
|
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event );
|
||||||
@ -324,6 +326,13 @@ comment
|
|||||||
Updates the item's button positions, based on the current item rect.
|
Updates the item's button positions, based on the current item rect.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
QColor fallbackColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the fallback color if the parameter or output does not have a
|
||||||
|
specific color.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
};
|
};
|
||||||
QFlags<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
QFlags<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
||||||
|
|
||||||
@ -362,6 +371,12 @@ Ownership of ``parameter`` is transferred to the item.
|
|||||||
virtual bool canDeleteComponent();
|
virtual bool canDeleteComponent();
|
||||||
|
|
||||||
|
|
||||||
|
virtual QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const;
|
||||||
|
|
||||||
|
|
||||||
|
virtual QColor linkColor( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QColor fillColor( State state ) const;
|
virtual QColor fillColor( State state ) const;
|
||||||
|
|
||||||
|
@ -182,6 +182,23 @@ Return the component associated to the socket.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Return the parent graphic item associated to the socket.
|
Return the parent graphic item associated to the socket.
|
||||||
%End
|
%End
|
||||||
|
QColor socketColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color of the socket based on the type of data the param
|
||||||
|
corresponds to.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
|
bool isDefaultParameterValue() const;
|
||||||
|
%Docstring
|
||||||
|
Returns ``True`` if the parameter is set to the default parameter value.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
signals:
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
# The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h
|
# The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName)
|
QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName)
|
||||||
QgsProcessingOutputMapLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputMapLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputMapLayer.__group__ = ['processing']
|
QgsProcessingOutputMapLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
||||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
||||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -25,13 +25,13 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
||||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'modelColor', 'valueAsString']
|
||||||
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
||||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputHtml.__group__ = ['processing']
|
QgsProcessingOutputHtml.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -43,31 +43,31 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
||||||
QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputNumber.__overridden_methods__ = ['modelColor', 'type', 'valueAsString']
|
||||||
QgsProcessingOutputNumber.__group__ = ['processing']
|
QgsProcessingOutputNumber.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
||||||
QgsProcessingOutputString.__overridden_methods__ = ['type']
|
QgsProcessingOutputString.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputString.__group__ = ['processing']
|
QgsProcessingOutputString.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
||||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString']
|
QgsProcessingOutputBoolean.__overridden_methods__ = ['modelColor', 'type', 'valueAsString']
|
||||||
QgsProcessingOutputBoolean.__group__ = ['processing']
|
QgsProcessingOutputBoolean.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
||||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputFolder.__group__ = ['processing']
|
QgsProcessingOutputFolder.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
||||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputFile.__group__ = ['processing']
|
QgsProcessingOutputFile.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -79,12 +79,12 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
||||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type']
|
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['modelColor', 'type']
|
||||||
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingOutputDefinition.__virtual_methods__ = ['valueAsString', 'valueAsFormattedString']
|
QgsProcessingOutputDefinition.__virtual_methods__ = ['modelColor', 'valueAsString', 'valueAsFormattedString']
|
||||||
QgsProcessingOutputDefinition.__abstract_methods__ = ['type']
|
QgsProcessingOutputDefinition.__abstract_methods__ = ['type']
|
||||||
QgsProcessingOutputDefinition.__group__ = ['processing']
|
QgsProcessingOutputDefinition.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -82,7 +82,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
||||||
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
||||||
QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||||
QgsProcessingParameterCrs.__group__ = ['processing']
|
QgsProcessingParameterCrs.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -103,7 +103,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName)
|
QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName)
|
||||||
QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode)
|
QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode)
|
||||||
QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterGeometry.__group__ = ['processing']
|
QgsProcessingParameterGeometry.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -137,25 +137,25 @@ except (NameError, AttributeError):
|
|||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
||||||
QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||||
QgsProcessingParameterDistance.__group__ = ['processing']
|
QgsProcessingParameterDistance.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName)
|
QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName)
|
||||||
QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterArea.__group__ = ['processing']
|
QgsProcessingParameterArea.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName)
|
QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName)
|
||||||
QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterVolume.__group__ = ['processing']
|
QgsProcessingParameterVolume.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName)
|
QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName)
|
||||||
QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterDuration.__group__ = ['processing']
|
QgsProcessingParameterDuration.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -183,7 +183,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
||||||
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
||||||
QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterEnum.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||||
QgsProcessingParameterEnum.__group__ = ['processing']
|
QgsProcessingParameterEnum.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -326,7 +326,7 @@ except (NameError, AttributeError):
|
|||||||
try:
|
try:
|
||||||
QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName)
|
QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName)
|
||||||
QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode)
|
QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode)
|
||||||
QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString']
|
||||||
QgsProcessingParameterDateTime.__group__ = ['processing']
|
QgsProcessingParameterDateTime.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
@ -389,7 +389,7 @@ try:
|
|||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterDefinition.__virtual_methods__ = ['isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip']
|
QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'userFriendlyString', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip']
|
||||||
QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type']
|
QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type']
|
||||||
QgsProcessingParameterDefinition.__group__ = ['processing']
|
QgsProcessingParameterDefinition.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h
|
# The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h
|
||||||
try:
|
try:
|
||||||
QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes']
|
QgsProcessingParameterType.defaultModelColor = staticmethod(QgsProcessingParameterType.defaultModelColor)
|
||||||
|
QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes', 'modelColor']
|
||||||
QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes']
|
QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes']
|
||||||
QgsProcessingParameterType.__group__ = ['processing']
|
QgsProcessingParameterType.__group__ = ['processing']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
|
@ -65,6 +65,13 @@ Constructor for QgsProcessingOutputDefinition.
|
|||||||
|
|
||||||
virtual ~QgsProcessingOutputDefinition();
|
virtual ~QgsProcessingOutputDefinition();
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the output in model designer windows.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QString type() const = 0;
|
virtual QString type() const = 0;
|
||||||
%Docstring
|
%Docstring
|
||||||
Unique output type name.
|
Unique output type name.
|
||||||
@ -189,6 +196,9 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or
|
|||||||
Constructor for QgsProcessingOutputMapLayer.
|
Constructor for QgsProcessingOutputMapLayer.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -215,6 +225,9 @@ A vector layer output for processing algorithms.
|
|||||||
Constructor for QgsProcessingOutputVectorLayer.
|
Constructor for QgsProcessingOutputVectorLayer.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -257,6 +270,9 @@ Constructor for QgsProcessingOutputRasterLayer.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -316,8 +332,10 @@ Returns the type name for the output class.
|
|||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -342,6 +360,9 @@ Constructor for QgsProcessingOutputHtml.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -370,6 +391,7 @@ Constructor for QgsProcessingOutputVariant.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
@ -393,6 +415,9 @@ A numeric output for processing algorithms.
|
|||||||
Constructor for QgsProcessingOutputNumber.
|
Constructor for QgsProcessingOutputNumber.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -423,6 +448,9 @@ Constructor for QgsProcessingOutputString.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -444,6 +472,9 @@ A boolean output for processing algorithms.
|
|||||||
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
@ -475,8 +506,10 @@ Constructor for QgsProcessingOutputFolder.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -501,8 +534,10 @@ Constructor for QgsProcessingOutputFile.
|
|||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -554,6 +589,9 @@ Constructor for QgsProcessingOutputVectorTileLayer.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the output class.
|
Returns the type name for the output class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -438,6 +438,27 @@ Constructor for QgsProcessingParameterDefinition.
|
|||||||
|
|
||||||
virtual ~QgsProcessingParameterDefinition();
|
virtual ~QgsProcessingParameterDefinition();
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the parameter in model designer windows.
|
||||||
|
|
||||||
|
The default implementation retrieves the color from the parameter type,
|
||||||
|
see :py:func:`QgsProcessingParameterType.modelColor()`.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
%Docstring
|
||||||
|
Returns a user-friendly string representation of the provided parameter
|
||||||
|
``value``.
|
||||||
|
|
||||||
|
The returned string is to be used for display purposes only, and should
|
||||||
|
be translated as required.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
Creates a clone of the parameter definition.
|
Creates a clone of the parameter definition.
|
||||||
@ -1994,6 +2015,9 @@ A coordinate reference system parameter for processing algorithms.
|
|||||||
Constructor for QgsProcessingParameterCrs.
|
Constructor for QgsProcessingParameterCrs.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
@ -2167,6 +2191,7 @@ Sets the allow multipart geometries
|
|||||||
.. seealso:: :py:func:`allowMultipart`
|
.. seealso:: :py:func:`allowMultipart`
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||||
@ -2316,6 +2341,7 @@ Constructor for QgsProcessingParameterMatrix.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -2512,6 +2538,7 @@ Constructor for QgsProcessingParameterNumber.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -2620,6 +2647,9 @@ Constructor for QgsProcessingParameterDistance.
|
|||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
||||||
|
|
||||||
|
|
||||||
@ -2758,6 +2788,8 @@ Sets the default area ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2848,6 +2880,8 @@ Sets the default volume ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2907,6 +2941,8 @@ Sets the default duration ``unit`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2977,6 +3013,7 @@ Constructor for QgsProcessingParameterRange.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -3106,6 +3143,9 @@ values.
|
|||||||
Constructor for QgsProcessingParameterEnum.
|
Constructor for QgsProcessingParameterEnum.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QString typeName();
|
static QString typeName();
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
@ -4523,6 +4563,7 @@ varying color opacity.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Returns the type name for the parameter class.
|
Returns the type name for the parameter class.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
@ -4861,6 +4902,8 @@ Sets the acceptable data ``type`` for the parameter.
|
|||||||
|
|
||||||
virtual bool fromVariantMap( const QVariantMap &map );
|
virtual bool fromVariantMap( const QVariantMap &map );
|
||||||
|
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
|
|
||||||
static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
|
@ -23,6 +23,13 @@ Makes metadata of processing parameters available.
|
|||||||
%End
|
%End
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static QColor defaultModelColor();
|
||||||
|
%Docstring
|
||||||
|
Returns the default color for a processing parameter.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
|
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
|
||||||
%Docstring
|
%Docstring
|
||||||
Creates a new parameter of this type.
|
Creates a new parameter of this type.
|
||||||
@ -175,6 +182,16 @@ for the parameter.
|
|||||||
.. seealso:: :py:func:`acceptedOutputTypes`
|
.. seealso:: :py:func:`acceptedOutputTypes`
|
||||||
|
|
||||||
.. versionadded:: 3.44
|
.. versionadded:: 3.44
|
||||||
|
%End
|
||||||
|
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color to use for the parameter in model designer windows.
|
||||||
|
|
||||||
|
The default implementation returns
|
||||||
|
:py:func:`~QgsProcessingParameterType.defaultModelColor`.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
%End
|
%End
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h
|
# The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h
|
||||||
try:
|
try:
|
||||||
QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"}
|
QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"}
|
||||||
QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap']
|
QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkedParameterDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap']
|
||||||
QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition']
|
QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition']
|
||||||
QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint']
|
QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint']
|
||||||
QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']}
|
QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']}
|
||||||
@ -15,7 +15,7 @@ try:
|
|||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent']
|
QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'linkedParameterDataType', 'linkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent']
|
||||||
QgsModelParameterGraphicItem.__group__ = ['processing', 'models']
|
QgsModelParameterGraphicItem.__group__ = ['processing', 'models']
|
||||||
except (NameError, AttributeError):
|
except (NameError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
@ -112,6 +112,8 @@ Shows a preview of moving the item from its stored position by ``dx``,
|
|||||||
Sets a new scene ``rect`` for the item.
|
Sets a new scene ``rect`` for the item.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event );
|
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event );
|
||||||
|
|
||||||
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event );
|
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event );
|
||||||
@ -324,6 +326,13 @@ comment
|
|||||||
Updates the item's button positions, based on the current item rect.
|
Updates the item's button positions, based on the current item rect.
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
QColor fallbackColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the fallback color if the parameter or output does not have a
|
||||||
|
specific color.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
};
|
};
|
||||||
QFlags<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
QFlags<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
||||||
|
|
||||||
@ -362,6 +371,12 @@ Ownership of ``parameter`` is transferred to the item.
|
|||||||
virtual bool canDeleteComponent();
|
virtual bool canDeleteComponent();
|
||||||
|
|
||||||
|
|
||||||
|
virtual QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const;
|
||||||
|
|
||||||
|
|
||||||
|
virtual QColor linkColor( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QColor fillColor( State state ) const;
|
virtual QColor fillColor( State state ) const;
|
||||||
|
|
||||||
|
@ -182,6 +182,23 @@ Return the component associated to the socket.
|
|||||||
%Docstring
|
%Docstring
|
||||||
Return the parent graphic item associated to the socket.
|
Return the parent graphic item associated to the socket.
|
||||||
%End
|
%End
|
||||||
|
QColor socketColor() const;
|
||||||
|
%Docstring
|
||||||
|
Returns the color of the socket based on the type of data the param
|
||||||
|
corresponds to.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
|
||||||
|
bool isDefaultParameterValue() const;
|
||||||
|
%Docstring
|
||||||
|
Returns ``True`` if the parameter is set to the default parameter value.
|
||||||
|
|
||||||
|
.. versionadded:: 4.0
|
||||||
|
%End
|
||||||
|
signals:
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,8 +224,21 @@ QString QgsProcessingModelChildParameterSource::friendlyIdentifier( QgsProcessin
|
|||||||
switch ( mSource )
|
switch ( mSource )
|
||||||
{
|
{
|
||||||
case Qgis::ProcessingModelChildParameterSource::ModelParameter:
|
case Qgis::ProcessingModelChildParameterSource::ModelParameter:
|
||||||
return model ? model->parameterDefinition( mParameterName )->description() : mParameterName;
|
{
|
||||||
|
|
||||||
|
if ( model )
|
||||||
|
{
|
||||||
|
const QgsProcessingParameterDefinition *paramDefinition = model->parameterDefinition( mParameterName );
|
||||||
|
|
||||||
|
// A model can be valid (non null) but we could be looking for a null parameter (if input if not set yet)
|
||||||
|
if ( paramDefinition )
|
||||||
|
{
|
||||||
|
return model->parameterDefinition( mParameterName )->description();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mParameterName;
|
||||||
|
}
|
||||||
case Qgis::ProcessingModelChildParameterSource::ChildOutput:
|
case Qgis::ProcessingModelChildParameterSource::ChildOutput:
|
||||||
{
|
{
|
||||||
if ( model )
|
if ( model )
|
||||||
@ -242,11 +255,11 @@ QString QgsProcessingModelChildParameterSource::friendlyIdentifier( QgsProcessin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QObject::tr( "'%1' from algorithm '%2'" ).arg( outputName, alg.description() );
|
return QObject::tr( "<%1>" ).arg( alg.description() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return QObject::tr( "'%1' from algorithm '%2'" ).arg( mOutputName, mChildId );
|
return QObject::tr( "<%1>" ).arg( mChildId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,11 @@ QString QgsProcessingOutputDefinition::valueAsFormattedString( const QVariant &v
|
|||||||
return valueAsString( value, context, ok );
|
return valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputDefinition::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 128, 128, 128 ); /* mid gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputVectorLayer::QgsProcessingOutputVectorLayer( const QString &name, const QString &description, Qgis::ProcessingSourceType type )
|
QgsProcessingOutputVectorLayer::QgsProcessingOutputVectorLayer( const QString &name, const QString &description, Qgis::ProcessingSourceType type )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
, mDataType( type )
|
, mDataType( type )
|
||||||
@ -63,10 +68,20 @@ void QgsProcessingOutputVectorLayer::setDataType( Qgis::ProcessingSourceType typ
|
|||||||
mDataType = type;
|
mDataType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputVectorLayer::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 122, 0, 47 ); /* burgundy */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &name, const QString &description )
|
QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputRasterLayer::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 0, 180, 180 ); /* turquoise */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputPointCloudLayer::QgsProcessingOutputPointCloudLayer( const QString &name, const QString &description )
|
QgsProcessingOutputPointCloudLayer::QgsProcessingOutputPointCloudLayer( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -75,6 +90,11 @@ QgsProcessingOutputVectorTileLayer::QgsProcessingOutputVectorTileLayer( const QS
|
|||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputVectorTileLayer::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 137, 150, 171 ); /* cold gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputHtml::QgsProcessingOutputHtml( const QString &name, const QString &description )
|
QgsProcessingOutputHtml::QgsProcessingOutputHtml( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -90,6 +110,11 @@ QString QgsProcessingOutputHtml::valueAsFormattedString( const QVariant &value,
|
|||||||
return valueAsString( value, context, ok );
|
return valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputHtml::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 255, 131, 23 ); /* orange */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description )
|
QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -112,10 +137,20 @@ QString QgsProcessingOutputNumber::valueAsString( const QVariant &value, QgsProc
|
|||||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputNumber::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 34, 157, 214 ); /* blue */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QString &description )
|
QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputString::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 255, 131, 23 ); /* orange */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputBoolean::QgsProcessingOutputBoolean( const QString &name, const QString &description )
|
QgsProcessingOutputBoolean::QgsProcessingOutputBoolean( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -131,6 +166,11 @@ QString QgsProcessingOutputBoolean::valueAsString( const QVariant &value, QgsPro
|
|||||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputBoolean::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 51, 201, 28 ); /* green */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputFolder::QgsProcessingOutputFolder( const QString &name, const QString &description )
|
QgsProcessingOutputFolder::QgsProcessingOutputFolder( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -146,6 +186,11 @@ QString QgsProcessingOutputFolder::valueAsFormattedString( const QVariant &value
|
|||||||
return valueAsString( value, context, ok );
|
return valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputFolder::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 80, 80, 80 ); /* dark gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputFile::QgsProcessingOutputFile( const QString &name, const QString &description )
|
QgsProcessingOutputFile::QgsProcessingOutputFile( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -161,6 +206,11 @@ QString QgsProcessingOutputFile::valueAsFormattedString( const QVariant &value,
|
|||||||
return valueAsString( value, context, ok );
|
return valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputFile::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 80, 80, 80 ); /* dark gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputMapLayer::QgsProcessingOutputMapLayer( const QString &name, const QString &description )
|
QgsProcessingOutputMapLayer::QgsProcessingOutputMapLayer( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -170,6 +220,11 @@ QString QgsProcessingOutputMapLayer::type() const
|
|||||||
return typeName();
|
return typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputMapLayer::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 137, 150, 171 ); /* cold gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputMultipleLayers::QgsProcessingOutputMultipleLayers( const QString &name, const QString &description )
|
QgsProcessingOutputMultipleLayers::QgsProcessingOutputMultipleLayers( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -210,6 +265,11 @@ QString QgsProcessingOutputMultipleLayers::valueAsString( const QVariant &value,
|
|||||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingOutputMultipleLayers::modelColor() const
|
||||||
|
{
|
||||||
|
return QColor( 137, 150, 171 ); /* cold gray */
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingOutputConditionalBranch::QgsProcessingOutputConditionalBranch( const QString &name, const QString &description )
|
QgsProcessingOutputConditionalBranch::QgsProcessingOutputConditionalBranch( const QString &name, const QString &description )
|
||||||
: QgsProcessingOutputDefinition( name, description )
|
: QgsProcessingOutputDefinition( name, description )
|
||||||
{}
|
{}
|
||||||
@ -266,3 +326,4 @@ QString QgsProcessingOutputVariant::valueAsString( const QVariant &value, QgsPro
|
|||||||
}
|
}
|
||||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#ifndef QGSPROCESSINGOUTPUTS_H
|
#ifndef QGSPROCESSINGOUTPUTS_H
|
||||||
#define QGSPROCESSINGOUTPUTS_H
|
#define QGSPROCESSINGOUTPUTS_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
#include "qgis_core.h"
|
#include "qgis_core.h"
|
||||||
#include "qgis.h"
|
#include "qgis.h"
|
||||||
|
|
||||||
@ -85,6 +86,13 @@ class CORE_EXPORT QgsProcessingOutputDefinition
|
|||||||
|
|
||||||
virtual ~QgsProcessingOutputDefinition() = default;
|
virtual ~QgsProcessingOutputDefinition() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the color to use for the output in model designer windows.
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unique output type name.
|
* Unique output type name.
|
||||||
*/
|
*/
|
||||||
@ -195,6 +203,8 @@ class CORE_EXPORT QgsProcessingOutputMapLayer : public QgsProcessingOutputDefini
|
|||||||
*/
|
*/
|
||||||
QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() );
|
QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() );
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
@ -218,6 +228,8 @@ class CORE_EXPORT QgsProcessingOutputVectorLayer : public QgsProcessingOutputDef
|
|||||||
*/
|
*/
|
||||||
QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry );
|
QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry );
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
@ -259,6 +271,8 @@ class CORE_EXPORT QgsProcessingOutputRasterLayer : public QgsProcessingOutputDef
|
|||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputRaster" ); }
|
static QString typeName() { return QStringLiteral( "outputRaster" ); }
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -310,8 +324,9 @@ class CORE_EXPORT QgsProcessingOutputMultipleLayers : public QgsProcessingOutput
|
|||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputMultilayer" ); }
|
static QString typeName() { return QStringLiteral( "outputMultilayer" ); }
|
||||||
QString type() const override;
|
QString type() const override;
|
||||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -333,6 +348,8 @@ class CORE_EXPORT QgsProcessingOutputHtml : public QgsProcessingOutputDefinition
|
|||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputHtml" ); }
|
static QString typeName() { return QStringLiteral( "outputHtml" ); }
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -356,6 +373,7 @@ class CORE_EXPORT QgsProcessingOutputVariant : public QgsProcessingOutputDefinit
|
|||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputVariant" ); }
|
static QString typeName() { return QStringLiteral( "outputVariant" ); }
|
||||||
|
|
||||||
QString type() const override;
|
QString type() const override;
|
||||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||||
|
|
||||||
@ -375,6 +393,8 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti
|
|||||||
*/
|
*/
|
||||||
QgsProcessingOutputNumber( const QString &name, const QString &description = QString() );
|
QgsProcessingOutputNumber( const QString &name, const QString &description = QString() );
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
@ -402,6 +422,8 @@ class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefiniti
|
|||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputString" ); }
|
static QString typeName() { return QStringLiteral( "outputString" ); }
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -420,6 +442,8 @@ class CORE_EXPORT QgsProcessingOutputBoolean : public QgsProcessingOutputDefinit
|
|||||||
*/
|
*/
|
||||||
QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() );
|
QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() );
|
||||||
|
|
||||||
|
QColor modelColor() const override ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
@ -448,8 +472,9 @@ class CORE_EXPORT QgsProcessingOutputFolder : public QgsProcessingOutputDefiniti
|
|||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputFolder" ); }
|
static QString typeName() { return QStringLiteral( "outputFolder" ); }
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -471,8 +496,9 @@ class CORE_EXPORT QgsProcessingOutputFile : public QgsProcessingOutputDefinition
|
|||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputFile" ); }
|
static QString typeName() { return QStringLiteral( "outputFile" ); }
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
|
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -517,6 +543,8 @@ class CORE_EXPORT QgsProcessingOutputVectorTileLayer : public QgsProcessingOutpu
|
|||||||
* Returns the type name for the output class.
|
* Returns the type name for the output class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "outputVectorTile" ); }
|
static QString typeName() { return QStringLiteral( "outputVectorTile" ); }
|
||||||
|
|
||||||
|
QColor modelColor() const override;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "qgsproviderregistry.h"
|
#include "qgsproviderregistry.h"
|
||||||
#include "qgsvariantutils.h"
|
#include "qgsvariantutils.h"
|
||||||
#include "qgsmessagelog.h"
|
#include "qgsmessagelog.h"
|
||||||
|
#include "qgsunittypes.h"
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
@ -66,7 +67,6 @@ bool QgsProcessingFeatureSourceDefinition::loadVariant( const QVariantMap &map )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingRasterLayerDefinition
|
// QgsProcessingRasterLayerDefinition
|
||||||
//
|
//
|
||||||
@ -3061,6 +3061,73 @@ QgsProcessingParameterDefinition *QgsProcessingParameterBoolean::clone() const
|
|||||||
return new QgsProcessingParameterBoolean( *this );
|
return new QgsProcessingParameterBoolean( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingParameterDefinition::modelColor() const
|
||||||
|
{
|
||||||
|
QgsProcessingParameterType *paramType = QgsApplication::processingRegistry()->parameterType( type() );
|
||||||
|
if ( paramType )
|
||||||
|
{
|
||||||
|
return paramType->modelColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QgsProcessingParameterType::defaultModelColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
if ( value.userType() == qMetaTypeId<QgsPointXY>() )
|
||||||
|
{
|
||||||
|
const QgsPointXY r = value.value<QgsPointXY>();
|
||||||
|
return QStringLiteral( "%1, %2" ).arg( qgsDoubleToString( r.x(), 4 ),
|
||||||
|
qgsDoubleToString( r.y(), 4 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == qMetaTypeId<QgsReferencedPointXY>() )
|
||||||
|
{
|
||||||
|
const QgsReferencedPointXY r = value.value<QgsReferencedPointXY>();
|
||||||
|
return QStringLiteral( "%1, %2 [%3]" ).arg(
|
||||||
|
qgsDoubleToString( r.x(), 4 ),
|
||||||
|
qgsDoubleToString( r.y(), 4 ),
|
||||||
|
r.crs().authid()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == qMetaTypeId<QgsRectangle>() )
|
||||||
|
{
|
||||||
|
const QgsGeometry g = QgsGeometry::fromRect( value.value<QgsRectangle>() );
|
||||||
|
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == qMetaTypeId<QgsReferencedRectangle>() )
|
||||||
|
{
|
||||||
|
const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( value.value<QgsReferencedRectangle>() );
|
||||||
|
if ( !g.isNull() )
|
||||||
|
{
|
||||||
|
|
||||||
|
return QStringLiteral( "%1 [%2]" ).arg( QgsWkbTypes::geometryDisplayString( g.type() ), g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) );
|
||||||
|
}
|
||||||
|
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == qMetaTypeId<QgsProcessingOutputLayerDefinition>() )
|
||||||
|
{
|
||||||
|
const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( value );
|
||||||
|
if ( fromVar.sink.propertyType() == Qgis::PropertyType::Static )
|
||||||
|
{
|
||||||
|
return fromVar.sink.staticValue().toString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return fromVar.sink.asExpression();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const
|
QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const
|
||||||
{
|
{
|
||||||
if ( !val.isValid() )
|
if ( !val.isValid() )
|
||||||
@ -3220,6 +3287,21 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr
|
|||||||
return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional );
|
return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsProcessingParameterCrs::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
QgsCoordinateReferenceSystem crs( value.toString() );
|
||||||
|
if ( crs.isValid() )
|
||||||
|
return crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString );
|
||||||
|
|
||||||
|
return QObject::tr( "Invalid CRS" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList<int> &types )
|
QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList<int> &types )
|
||||||
: QgsProcessingParameterDefinition( name, description, defaultValue, optional )
|
: QgsProcessingParameterDefinition( name, description, defaultValue, optional )
|
||||||
, QgsProcessingParameterLimitedDataTypes( types )
|
, QgsProcessingParameterLimitedDataTypes( types )
|
||||||
@ -3652,7 +3734,8 @@ QString QgsProcessingParameterExtent::valueAsPythonString( const QVariant &value
|
|||||||
return QStringLiteral( "'%1, %3, %2, %4 [%5]'" ).arg( qgsDoubleToString( r.xMinimum() ),
|
return QStringLiteral( "'%1, %3, %2, %4 [%5]'" ).arg( qgsDoubleToString( r.xMinimum() ),
|
||||||
qgsDoubleToString( r.yMinimum() ),
|
qgsDoubleToString( r.yMinimum() ),
|
||||||
qgsDoubleToString( r.xMaximum() ),
|
qgsDoubleToString( r.xMaximum() ),
|
||||||
qgsDoubleToString( r.yMaximum() ), r.crs().authid() );
|
qgsDoubleToString( r.yMaximum() ),
|
||||||
|
r.crs().authid() );
|
||||||
}
|
}
|
||||||
else if ( value.userType() == qMetaTypeId< QgsGeometry>() )
|
else if ( value.userType() == qMetaTypeId< QgsGeometry>() )
|
||||||
{
|
{
|
||||||
@ -3802,6 +3885,7 @@ QgsProcessingParameterPoint *QgsProcessingParameterPoint::fromScriptCode( const
|
|||||||
return new QgsProcessingParameterPoint( name, description, definition, isOptional );
|
return new QgsProcessingParameterPoint( name, description, definition, isOptional );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QgsProcessingParameterGeometry::QgsProcessingParameterGeometry( const QString &name, const QString &description,
|
QgsProcessingParameterGeometry::QgsProcessingParameterGeometry( const QString &name, const QString &description,
|
||||||
const QVariant &defaultValue, bool optional, const QList<int> &geometryTypes, bool allowMultipart )
|
const QVariant &defaultValue, bool optional, const QList<int> &geometryTypes, bool allowMultipart )
|
||||||
: QgsProcessingParameterDefinition( name, description, defaultValue, optional ),
|
: QgsProcessingParameterDefinition( name, description, defaultValue, optional ),
|
||||||
@ -4073,6 +4157,45 @@ QgsProcessingParameterGeometry *QgsProcessingParameterGeometry::fromScriptCode(
|
|||||||
return new QgsProcessingParameterGeometry( name, description, definition, isOptional );
|
return new QgsProcessingParameterGeometry( name, description, definition, isOptional );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
if ( value.isValid() )
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( value.userType() == qMetaTypeId< QgsGeometry>() )
|
||||||
|
{
|
||||||
|
const QgsGeometry g = value.value<QgsGeometry>();
|
||||||
|
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == qMetaTypeId<QgsReferencedGeometry>() )
|
||||||
|
{
|
||||||
|
const QgsReferencedGeometry g = value.value<QgsReferencedGeometry>();
|
||||||
|
if ( !g.isNull() )
|
||||||
|
{
|
||||||
|
return QStringLiteral( "%1 [%2]" ).arg( QgsWkbTypes::geometryDisplayString( g.type() ), g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ));
|
||||||
|
}
|
||||||
|
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == QMetaType::QString )
|
||||||
|
{
|
||||||
|
// In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed
|
||||||
|
// rather than the possibly very long WKT payload
|
||||||
|
QgsGeometry g = QgsGeometry::fromWkt( value.toString() );
|
||||||
|
if ( !g.isNull() )
|
||||||
|
{
|
||||||
|
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QObject::tr( "Invalid geometry" );
|
||||||
|
}
|
||||||
|
|
||||||
QgsProcessingParameterFile::QgsProcessingParameterFile( const QString &name, const QString &description, Qgis::ProcessingFileParameterBehavior behavior, const QString &extension, const QVariant &defaultValue, bool optional, const QString &fileFilter )
|
QgsProcessingParameterFile::QgsProcessingParameterFile( const QString &name, const QString &description, Qgis::ProcessingFileParameterBehavior behavior, const QString &extension, const QVariant &defaultValue, bool optional, const QString &fileFilter )
|
||||||
: QgsProcessingParameterDefinition( name, description, defaultValue, optional )
|
: QgsProcessingParameterDefinition( name, description, defaultValue, optional )
|
||||||
, mBehavior( behavior )
|
, mBehavior( behavior )
|
||||||
@ -5391,6 +5514,14 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QgsProcessingParameterEnum::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
return options().at( value.toInt() );
|
||||||
|
}
|
||||||
|
|
||||||
QStringList QgsProcessingParameterEnum::options() const
|
QStringList QgsProcessingParameterEnum::options() const
|
||||||
{
|
{
|
||||||
return mOptions;
|
return mOptions;
|
||||||
@ -7855,6 +7986,14 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsProcessingParameterDistance::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingParameterArea
|
// QgsProcessingParameterArea
|
||||||
@ -7937,6 +8076,14 @@ bool QgsProcessingParameterArea::fromVariantMap( const QVariantMap &map )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsProcessingParameterArea::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingParameterVolume
|
// QgsProcessingParameterVolume
|
||||||
@ -8018,6 +8165,13 @@ bool QgsProcessingParameterVolume::fromVariantMap( const QVariantMap &map )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QgsProcessingParameterVolume::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingParameterDuration
|
// QgsProcessingParameterDuration
|
||||||
@ -8075,6 +8229,14 @@ bool QgsProcessingParameterDuration::fromVariantMap( const QVariantMap &map )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QgsProcessingParameterDuration::userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingParameterScale
|
// QgsProcessingParameterScale
|
||||||
@ -8932,6 +9094,40 @@ QgsProcessingParameterDateTime *QgsProcessingParameterDateTime::fromScriptCode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsProcessingParameterDateTime:: userFriendlyString( const QVariant &value ) const
|
||||||
|
{
|
||||||
|
if ( QgsVariantUtils::isNull( value ) )
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
if ( value.userType() == QMetaType::Type::QDateTime )
|
||||||
|
{
|
||||||
|
const QDateTime dt = value.toDateTime();
|
||||||
|
if ( !dt.isValid() )
|
||||||
|
return QObject::tr( "Invalid datetime" );
|
||||||
|
else
|
||||||
|
return dt.toString( Qt::ISODate );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == QMetaType::Type::QDate )
|
||||||
|
{
|
||||||
|
const QDate dt = value.toDate();
|
||||||
|
if ( !dt.isValid() )
|
||||||
|
return QObject::tr( "Invalid date" );
|
||||||
|
else
|
||||||
|
return dt.toString( Qt::ISODate );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( value.userType() == QMetaType::Type::QTime )
|
||||||
|
{
|
||||||
|
const QTime dt = value.toTime();
|
||||||
|
if ( !dt.isValid() )
|
||||||
|
return QObject::tr( "Invalid time" );
|
||||||
|
else
|
||||||
|
return dt.toString( Qt::ISODate );
|
||||||
|
}
|
||||||
|
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// QgsProcessingParameterProviderConnection
|
// QgsProcessingParameterProviderConnection
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "qgsremappingproxyfeaturesink.h"
|
#include "qgsremappingproxyfeaturesink.h"
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
class QgsProcessingContext;
|
class QgsProcessingContext;
|
||||||
class QgsProcessingAlgorithm;
|
class QgsProcessingAlgorithm;
|
||||||
@ -554,6 +555,23 @@ class CORE_EXPORT QgsProcessingParameterDefinition
|
|||||||
|
|
||||||
virtual ~QgsProcessingParameterDefinition() = default;
|
virtual ~QgsProcessingParameterDefinition() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the color to use for the parameter in model designer windows.
|
||||||
|
*
|
||||||
|
* The default implementation retrieves the color from the parameter type, see QgsProcessingParameterType::modelColor().
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a user-friendly string representation of the provided parameter \a value.
|
||||||
|
*
|
||||||
|
* The returned string is to be used for display purposes only, and should be translated as required.
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QString userFriendlyString( const QVariant &value ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a clone of the parameter definition.
|
* Creates a clone of the parameter definition.
|
||||||
*/
|
*/
|
||||||
@ -1906,6 +1924,8 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin
|
|||||||
QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
|
QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
|
||||||
bool optional = false );
|
bool optional = false );
|
||||||
|
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
@ -2054,7 +2074,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter
|
|||||||
*/
|
*/
|
||||||
void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; }
|
void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; }
|
||||||
|
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new parameter using the definition from a script code.
|
* Creates a new parameter using the definition from a script code.
|
||||||
@ -2185,6 +2205,7 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe
|
|||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "matrix" ); }
|
static QString typeName() { return QStringLiteral( "matrix" ); }
|
||||||
|
|
||||||
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||||
@ -2356,6 +2377,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
|
|||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "number" ); }
|
static QString typeName() { return QStringLiteral( "number" ); }
|
||||||
|
|
||||||
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||||
@ -2454,6 +2476,8 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter
|
|||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember
|
static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember
|
||||||
|
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
QgsProcessingParameterDistance *clone() const override SIP_FACTORY;
|
QgsProcessingParameterDistance *clone() const override SIP_FACTORY;
|
||||||
|
|
||||||
QString type() const override;
|
QString type() const override;
|
||||||
@ -2573,6 +2597,7 @@ class CORE_EXPORT QgsProcessingParameterArea : public QgsProcessingParameterNumb
|
|||||||
|
|
||||||
QVariantMap toVariantMap() const override;
|
QVariantMap toVariantMap() const override;
|
||||||
bool fromVariantMap( const QVariantMap &map ) override;
|
bool fromVariantMap( const QVariantMap &map ) override;
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -2656,6 +2681,7 @@ class CORE_EXPORT QgsProcessingParameterVolume : public QgsProcessingParameterNu
|
|||||||
|
|
||||||
QVariantMap toVariantMap() const override;
|
QVariantMap toVariantMap() const override;
|
||||||
bool fromVariantMap( const QVariantMap &map ) override;
|
bool fromVariantMap( const QVariantMap &map ) override;
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -2712,6 +2738,7 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter
|
|||||||
|
|
||||||
QVariantMap toVariantMap() const override;
|
QVariantMap toVariantMap() const override;
|
||||||
bool fromVariantMap( const QVariantMap &map ) override;
|
bool fromVariantMap( const QVariantMap &map ) override;
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -2778,6 +2805,7 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef
|
|||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "range" ); }
|
static QString typeName() { return QStringLiteral( "range" ); }
|
||||||
|
|
||||||
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||||
@ -2889,6 +2917,8 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi
|
|||||||
bool optional = false,
|
bool optional = false,
|
||||||
bool usesStaticStrings = false );
|
bool usesStaticStrings = false );
|
||||||
|
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
@ -4090,6 +4120,7 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef
|
|||||||
* Returns the type name for the parameter class.
|
* Returns the type name for the parameter class.
|
||||||
*/
|
*/
|
||||||
static QString typeName() { return QStringLiteral( "color" ); }
|
static QString typeName() { return QStringLiteral( "color" ); }
|
||||||
|
|
||||||
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
|
||||||
QString type() const override { return typeName(); }
|
QString type() const override { return typeName(); }
|
||||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||||
@ -4373,6 +4404,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter
|
|||||||
|
|
||||||
QVariantMap toVariantMap() const override;
|
QVariantMap toVariantMap() const override;
|
||||||
bool fromVariantMap( const QVariantMap &map ) override;
|
bool fromVariantMap( const QVariantMap &map ) override;
|
||||||
|
QString userFriendlyString( const QVariant &value ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new parameter using the definition from a script code.
|
* Creates a new parameter using the definition from a script code.
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
#include "qgsprocessingparametertype.h"
|
#include "qgsprocessingparametertype.h"
|
||||||
|
|
||||||
|
QColor QgsProcessingParameterType::defaultModelColor()
|
||||||
|
{
|
||||||
|
return QColor( 128, 128, 128 ); /* mid gray */
|
||||||
|
}
|
||||||
|
|
||||||
Qgis::ProcessingParameterTypeFlags QgsProcessingParameterType::flags() const
|
Qgis::ProcessingParameterTypeFlags QgsProcessingParameterType::flags() const
|
||||||
{
|
{
|
||||||
return Qgis::ProcessingParameterTypeFlag::ExposeToModeler;
|
return Qgis::ProcessingParameterTypeFlag::ExposeToModeler;
|
||||||
@ -51,3 +56,8 @@ QList<int> QgsProcessingParameterType::acceptedDataTypes( const QgsProcessingPar
|
|||||||
{
|
{
|
||||||
return QList<int>();
|
return QList<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor QgsProcessingParameterType::modelColor() const
|
||||||
|
{
|
||||||
|
return defaultModelColor();
|
||||||
|
}
|
||||||
|
@ -34,6 +34,13 @@ class CORE_EXPORT QgsProcessingParameterType
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the default color for a processing parameter.
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
static QColor defaultModelColor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new parameter of this type.
|
* Creates a new parameter of this type.
|
||||||
*/
|
*/
|
||||||
@ -171,6 +178,15 @@ class CORE_EXPORT QgsProcessingParameterType
|
|||||||
*/
|
*/
|
||||||
virtual QList<int> acceptedDataTypes( const QgsProcessingParameterDefinition *parameter ) const;
|
virtual QList<int> acceptedDataTypes( const QgsProcessingParameterDefinition *parameter ) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the color to use for the parameter in model designer windows.
|
||||||
|
*
|
||||||
|
* The default implementation returns defaultModelColor().
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QColor modelColor() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QGSPROCESSINGPARAMETERTYPE_H
|
#endif // QGSPROCESSINGPARAMETERTYPE_H
|
||||||
|
@ -97,6 +97,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRasterLayer : public QgsProcessingPa
|
|||||||
<< QgsProcessingOutputFile::typeName()
|
<< QgsProcessingOutputFile::typeName()
|
||||||
<< QgsProcessingOutputFolder::typeName();
|
<< QgsProcessingOutputFolder::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,6 +171,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMeshLayer : public QgsProcessingPara
|
|||||||
<< QgsProcessingOutputFile::typeName()
|
<< QgsProcessingOutputFile::typeName()
|
||||||
<< QgsProcessingOutputFolder::typeName();
|
<< QgsProcessingOutputFolder::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -250,6 +254,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorLayer : public QgsProcessingPa
|
|||||||
else
|
else
|
||||||
return QList<int>();
|
return QList<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -330,6 +336,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMapLayer : public QgsProcessingParam
|
|||||||
<< QgsProcessingOutputFile::typeName()
|
<< QgsProcessingOutputFile::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -421,6 +429,8 @@ class CORE_EXPORT QgsProcessingParameterTypeBoolean : public QgsProcessingParame
|
|||||||
<< QgsProcessingOutputVariant::typeName()
|
<< QgsProcessingOutputVariant::typeName()
|
||||||
<< QgsProcessingOutputBoolean::typeName();
|
<< QgsProcessingOutputBoolean::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 51, 201, 28 ); /* green */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -493,6 +503,8 @@ class CORE_EXPORT QgsProcessingParameterTypeExpression : public QgsProcessingPar
|
|||||||
<< QgsProcessingOutputNumber::typeName()
|
<< QgsProcessingOutputNumber::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -580,6 +592,8 @@ class CORE_EXPORT QgsProcessingParameterTypeCrs : public QgsProcessingParameterT
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -646,6 +660,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRange : public QgsProcessingParamete
|
|||||||
return QStringList() << QgsProcessingOutputString::typeName()
|
return QStringList() << QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -714,6 +730,8 @@ class CORE_EXPORT QgsProcessingParameterTypePoint : public QgsProcessingParamete
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -782,6 +800,8 @@ class CORE_EXPORT QgsProcessingParameterTypeGeometry : public QgsProcessingParam
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -851,6 +871,8 @@ class CORE_EXPORT QgsProcessingParameterTypeEnum : public QgsProcessingParameter
|
|||||||
<< QgsProcessingOutputVariant::typeName()
|
<< QgsProcessingOutputVariant::typeName()
|
||||||
<< QgsProcessingOutputNumber::typeName();
|
<< QgsProcessingOutputNumber::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 152, 68, 201 ); /* purple */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -935,6 +957,8 @@ class CORE_EXPORT QgsProcessingParameterTypeExtent : public QgsProcessingParamet
|
|||||||
<< QgsProcessingOutputMapLayer::typeName()
|
<< QgsProcessingOutputMapLayer::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -998,6 +1022,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMatrix : public QgsProcessingParamet
|
|||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1067,6 +1093,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFile : public QgsProcessingParameter
|
|||||||
<< QgsProcessingOutputVectorLayer::typeName()
|
<< QgsProcessingOutputVectorLayer::typeName()
|
||||||
<< QgsProcessingOutputMapLayer::typeName();
|
<< QgsProcessingOutputMapLayer::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1224,6 +1252,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorDestination : public QgsProces
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "Path for new vector layer" );
|
return QStringList() << QObject::tr( "Path for new vector layer" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1300,6 +1330,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFileDestination : public QgsProcessi
|
|||||||
<< QgsProcessingOutputVectorLayer::typeName()
|
<< QgsProcessingOutputVectorLayer::typeName()
|
||||||
<< QgsProcessingOutputMapLayer::typeName();
|
<< QgsProcessingOutputMapLayer::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1375,6 +1407,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFolderDestination : public QgsProces
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1435,6 +1469,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRasterDestination : public QgsProces
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "Path for new raster layer" );
|
return QStringList() << QObject::tr( "Path for new raster layer" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1515,6 +1551,8 @@ class CORE_EXPORT QgsProcessingParameterTypeString : public QgsProcessingParamet
|
|||||||
<< QgsProcessingOutputFolder::typeName()
|
<< QgsProcessingOutputFolder::typeName()
|
||||||
<< QgsProcessingOutputString::typeName();
|
<< QgsProcessingOutputString::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1652,6 +1690,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMultipleLayers : public QgsProcessin
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1735,6 +1775,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFeatureSource : public QgsProcessing
|
|||||||
else
|
else
|
||||||
return QList<int>();
|
return QList<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1807,6 +1849,8 @@ class CORE_EXPORT QgsProcessingParameterTypeNumber : public QgsProcessingParamet
|
|||||||
<< QgsProcessingOutputVariant::typeName()
|
<< QgsProcessingOutputVariant::typeName()
|
||||||
<< QgsProcessingOutputString::typeName();
|
<< QgsProcessingOutputString::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1861,6 +1905,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDistance : public QgsProcessingParam
|
|||||||
<< QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" )
|
<< QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" )
|
||||||
<< QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" );
|
<< QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2027,6 +2073,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDuration : public QgsProcessingParam
|
|||||||
<< QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" )
|
<< QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" )
|
||||||
<< QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" );
|
<< QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2079,6 +2127,8 @@ class CORE_EXPORT QgsProcessingParameterTypeScale : public QgsProcessingParamete
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "A numeric value representing the scale denominator" );
|
return QStringList() << QObject::tr( "A numeric value representing the scale denominator" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2205,6 +2255,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFeatureSink : public QgsProcessingPa
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "Path for new vector layer" );
|
return QStringList() << QObject::tr( "Path for new vector layer" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2404,6 +2456,8 @@ class CORE_EXPORT QgsProcessingParameterTypeColor : public QgsProcessingParamete
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2603,6 +2657,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDateTime : public QgsProcessingParam
|
|||||||
<< QgsProcessingOutputString::typeName()
|
<< QgsProcessingOutputString::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2873,6 +2929,8 @@ class CORE_EXPORT QgsProcessingParameterTypePointCloudLayer : public QgsProcessi
|
|||||||
<< QgsProcessingOutputFile::typeName()
|
<< QgsProcessingOutputFile::typeName()
|
||||||
<< QgsProcessingOutputFolder::typeName();
|
<< QgsProcessingOutputFolder::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2943,6 +3001,8 @@ class CORE_EXPORT QgsProcessingParameterTypeAnnotationLayer : public QgsProcessi
|
|||||||
<< QgsProcessingOutputMapLayer::typeName()
|
<< QgsProcessingOutputMapLayer::typeName()
|
||||||
<< QgsProcessingOutputVariant::typeName();
|
<< QgsProcessingOutputVariant::typeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3003,6 +3063,8 @@ class CORE_EXPORT QgsProcessingParameterTypePointCloudDestination : public QgsPr
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "Path for new point cloud layer" );
|
return QStringList() << QObject::tr( "Path for new point cloud layer" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3129,6 +3191,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorTileDestination : public QgsPr
|
|||||||
{
|
{
|
||||||
return QStringList() << QObject::tr( "Path for new vector tile layer" );
|
return QStringList() << QObject::tr( "Path for new vector tile layer" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QGSPROCESSINGPARAMETERTYPEIMPL_H
|
#endif // QGSPROCESSINGPARAMETERTYPEIMPL_H
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "qgsapplication.h"
|
#include "qgsapplication.h"
|
||||||
#include "qgsmodelgraphicsscene.h"
|
#include "qgsmodelgraphicsscene.h"
|
||||||
#include "qgsmodelcomponentgraphicitem.h"
|
#include "qgsmodelcomponentgraphicitem.h"
|
||||||
|
#include "qgsmodelgraphicitem.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
@ -72,7 +73,7 @@ QgsModelArrowItem::QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, M
|
|||||||
|
|
||||||
void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * )
|
void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * )
|
||||||
{
|
{
|
||||||
QColor color = mColor;
|
QColor color = mStartItem->linkColor( mStartEdge, mStartIndex );
|
||||||
|
|
||||||
if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected )
|
if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected )
|
||||||
color.setAlpha( 220 );
|
color.setAlpha( 220 );
|
||||||
@ -81,22 +82,23 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem
|
|||||||
else
|
else
|
||||||
color.setAlpha( 80 );
|
color.setAlpha( 80 );
|
||||||
|
|
||||||
|
//
|
||||||
QPen p = pen();
|
QPen p = pen();
|
||||||
p.setColor( color );
|
p.setColor( color );
|
||||||
p.setWidth( 1 );
|
p.setWidth( 0 );
|
||||||
painter->setPen( p );
|
painter->setPen( p );
|
||||||
|
|
||||||
painter->setBrush( color );
|
painter->setBrush( color );
|
||||||
painter->setRenderHint( QPainter::Antialiasing );
|
painter->setRenderHint( QPainter::Antialiasing );
|
||||||
|
|
||||||
|
|
||||||
switch ( mStartMarker )
|
switch ( mStartMarker )
|
||||||
{
|
{
|
||||||
case Marker::Circle:
|
|
||||||
painter->drawEllipse( mStartPoint, 3.0, 3.0 );
|
|
||||||
break;
|
|
||||||
case Marker::ArrowHead:
|
case Marker::ArrowHead:
|
||||||
drawArrowHead( painter, mStartPoint, path().pointAtPercent( 0.0 ) - path().pointAtPercent( 0.05 ) );
|
drawArrowHead( painter, mStartPoint, path().pointAtPercent( 0.0 ) - path().pointAtPercent( 0.05 ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// start marker are no longer drawn
|
||||||
|
case Marker::Circle:
|
||||||
case Marker::NoMarker:
|
case Marker::NoMarker:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -113,7 +115,26 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
painter->setBrush( color );
|
||||||
|
painter->setRenderHint( QPainter::Antialiasing );
|
||||||
painter->setBrush( Qt::NoBrush );
|
painter->setBrush( Qt::NoBrush );
|
||||||
|
|
||||||
|
// Set the painter back to regular stroke thickness
|
||||||
|
p = pen();
|
||||||
|
QColor endColor = mEndItem->linkColor( mEndEdge, mEndIndex );
|
||||||
|
color.setAlpha( 255 );
|
||||||
|
|
||||||
|
QLinearGradient gradient;
|
||||||
|
QPointF startPoint = path().pointAtPercent( 0.3 );
|
||||||
|
QPointF endPoint = path().pointAtPercent( 0.7 );
|
||||||
|
gradient.setStart( startPoint );
|
||||||
|
gradient.setFinalStop( endPoint );
|
||||||
|
gradient.setColorAt( 0, color );
|
||||||
|
gradient.setColorAt( 1, endColor );
|
||||||
|
|
||||||
|
p.setBrush( QBrush( gradient ) );
|
||||||
|
p.setWidth( 2 );
|
||||||
|
painter->setPen( p );
|
||||||
painter->drawPath( path() );
|
painter->drawPath( path() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "qgsmodelviewmouseevent.h"
|
#include "qgsmodelviewmouseevent.h"
|
||||||
#include "qgsmodelgroupboxdefinitionwidget.h"
|
#include "qgsmodelgroupboxdefinitionwidget.h"
|
||||||
#include "qgsmessagelog.h"
|
#include "qgsmessagelog.h"
|
||||||
|
#include "qgsprocessingparameters.h"
|
||||||
|
|
||||||
#include <QSvgRenderer>
|
#include <QSvgRenderer>
|
||||||
#include <QPicture>
|
#include <QPicture>
|
||||||
@ -496,23 +497,32 @@ QPixmap QgsModelComponentGraphicItem::iconPixmap() const
|
|||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QgsModelComponentGraphicItem::updateButtonPositions()
|
void QgsModelComponentGraphicItem::updateButtonPositions()
|
||||||
{
|
{
|
||||||
mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) );
|
mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) );
|
||||||
mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) );
|
mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) );
|
||||||
|
|
||||||
if ( mExpandTopButton )
|
|
||||||
{
|
|
||||||
const QPointF pt = linkPoint( Qt::TopEdge, -1, true );
|
|
||||||
mExpandTopButton->setPosition( QPointF( 0, pt.y() ) );
|
|
||||||
}
|
|
||||||
if ( mExpandBottomButton )
|
if ( mExpandBottomButton )
|
||||||
{
|
{
|
||||||
const QPointF pt = linkPoint( Qt::BottomEdge, -1, false );
|
const QPointF pt = linkPoint( Qt::BottomEdge, -1, false );
|
||||||
mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) );
|
mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) );
|
||||||
|
|
||||||
|
bool collapsed = mComponent->linksCollapsed( Qt::BottomEdge );
|
||||||
|
for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) )
|
||||||
|
{
|
||||||
|
const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false );
|
||||||
|
socket->setPosition( pt );
|
||||||
|
socket->setVisible( !collapsed );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( mExpandTopButton )
|
||||||
|
{
|
||||||
|
const QPointF pt = linkPoint( Qt::TopEdge, -1, true );
|
||||||
|
mExpandTopButton->setPosition( QPointF( 0, pt.y() ) );
|
||||||
|
|
||||||
bool collapsed = mComponent->linksCollapsed( Qt::TopEdge );
|
bool collapsed = mComponent->linksCollapsed( Qt::TopEdge );
|
||||||
for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) )
|
for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) )
|
||||||
{
|
{
|
||||||
@ -520,16 +530,10 @@ void QgsModelComponentGraphicItem::updateButtonPositions()
|
|||||||
socket->setPosition( pt );
|
socket->setPosition( pt );
|
||||||
socket->setVisible( !collapsed );
|
socket->setVisible( !collapsed );
|
||||||
}
|
}
|
||||||
|
|
||||||
collapsed = mComponent->linksCollapsed( Qt::BottomEdge );
|
|
||||||
for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) )
|
|
||||||
{
|
|
||||||
const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false );
|
|
||||||
socket->setPosition( pt );
|
|
||||||
socket->setVisible( !collapsed );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QSizeF QgsModelComponentGraphicItem::itemSize() const
|
QSizeF QgsModelComponentGraphicItem::itemSize() const
|
||||||
{
|
{
|
||||||
return !mTempSize.isValid() ? mComponent->size() : mTempSize;
|
return !mTempSize.isValid() ? mComponent->size() : mTempSize;
|
||||||
@ -563,15 +567,19 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded )
|
|||||||
|
|
||||||
// TODO - this is not so nice, consider moving this to model class
|
// TODO - this is not so nice, consider moving this to model class
|
||||||
if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast<QgsProcessingModelChildAlgorithm *>( mComponent.get() ) )
|
if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast<QgsProcessingModelChildAlgorithm *>( mComponent.get() ) )
|
||||||
|
{
|
||||||
mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded );
|
mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded );
|
||||||
|
}
|
||||||
else if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( mComponent.get() ) )
|
else if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( mComponent.get() ) )
|
||||||
|
{
|
||||||
mModel->parameterComponent( param->parameterName() ).setLinksCollapsed( edge, folded );
|
mModel->parameterComponent( param->parameterName() ).setLinksCollapsed( edge, folded );
|
||||||
|
}
|
||||||
else if ( QgsProcessingModelOutput *output = dynamic_cast<QgsProcessingModelOutput *>( mComponent.get() ) )
|
else if ( QgsProcessingModelOutput *output = dynamic_cast<QgsProcessingModelOutput *>( mComponent.get() ) )
|
||||||
|
{
|
||||||
mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded );
|
mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded );
|
||||||
|
}
|
||||||
|
|
||||||
updateButtonPositions();
|
updateButtonPositions();
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
emit updateArrowPaths();
|
emit updateArrowPaths();
|
||||||
emit changed();
|
emit changed();
|
||||||
@ -627,8 +635,8 @@ QPointF QgsModelComponentGraphicItem::linkPoint( Qt::Edge edge, int index, bool
|
|||||||
const QFontMetricsF fm( mFont );
|
const QFontMetricsF fm( mFont );
|
||||||
const double w = fm.boundingRect( text ).width();
|
const double w = fm.boundingRect( text ).width();
|
||||||
const double h = fm.height() * 1.2 * ( pointIndex + 1 ) + fm.height() / 2.0;
|
const double h = fm.height() * 1.2 * ( pointIndex + 1 ) + fm.height() / 2.0;
|
||||||
const double y = h + itemSize().height() / 2.0 + 5;
|
const double y = h + itemSize().height() / 2.0 + 6.4;
|
||||||
const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 5 ) : 10;
|
const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 10 ) : 10.4;
|
||||||
return QPointF( incoming ? -itemSize().width() / 2 + offsetX : x, y );
|
return QPointF( incoming ? -itemSize().width() / 2 + offsetX : x, y );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -756,8 +764,8 @@ QgsModelParameterGraphicItem::QgsModelParameterGraphicItem( QgsProcessingModelPa
|
|||||||
svg.render( &painter );
|
svg.render( &painter );
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
if ( const QgsProcessingParameterDefinition *paramDef = model->parameterDefinition( parameter->parameterName() ) )
|
if ( const QgsProcessingParameterDefinition *parameterDefinition = model->parameterDefinition( parameter->parameterName() ) )
|
||||||
setLabel( paramDef->description() );
|
setLabel( parameterDefinition->description() );
|
||||||
else
|
else
|
||||||
setLabel( QObject::tr( "Error (%1)" ).arg( parameter->parameterName() ) );
|
setLabel( QObject::tr( "Error (%1)" ).arg( parameter->parameterName() ) );
|
||||||
}
|
}
|
||||||
@ -838,17 +846,59 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) )
|
if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) )
|
||||||
{
|
{
|
||||||
QString text = this->model()->parameterDefinition( parameter->parameterName() )->type();
|
QString text = this->model()->parameterDefinition( parameter->parameterName() )->type();
|
||||||
|
|
||||||
|
// Getting the default value to append to the box name
|
||||||
|
if ( const QgsProcessingParameterDefinition *paramDef = this->model()->parameterDefinition( parameter->parameterName() ) )
|
||||||
|
{
|
||||||
|
const QVariant paramValue = paramDef->defaultValue();
|
||||||
|
|
||||||
|
if ( paramValue.isValid() )
|
||||||
|
{
|
||||||
|
text += ": " + paramDef->userFriendlyString( paramValue );
|
||||||
|
}
|
||||||
|
}
|
||||||
return truncatedTextForItem( text );
|
return truncatedTextForItem( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsModelParameterGraphicItem::linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const
|
||||||
|
{
|
||||||
|
if ( index < 0 )
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) )
|
||||||
|
{
|
||||||
|
return this->model()->parameterDefinition( parameter->parameterName() )->type();
|
||||||
|
}
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QColor QgsModelParameterGraphicItem::linkColor( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const
|
||||||
|
{
|
||||||
|
if ( index < 0 )
|
||||||
|
{
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) )
|
||||||
|
{
|
||||||
|
return this->model()->parameterDefinition( parameter->parameterName() )->modelColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void QgsModelParameterGraphicItem::updateStoredComponentPosition( const QPointF &pos, const QSizeF &size )
|
void QgsModelParameterGraphicItem::updateStoredComponentPosition( const QPointF &pos, const QSizeF &size )
|
||||||
{
|
{
|
||||||
if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( component() ) )
|
if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( component() ) )
|
||||||
@ -1087,6 +1137,88 @@ int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge ) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsModelComponentGraphicItem::linkedParameterDataType( Qt::Edge edge, int index ) const
|
||||||
|
{
|
||||||
|
if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast<const QgsProcessingModelChildAlgorithm *>( component() ) )
|
||||||
|
{
|
||||||
|
if ( !child->algorithm() )
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( edge )
|
||||||
|
{
|
||||||
|
case Qt::BottomEdge:
|
||||||
|
{
|
||||||
|
if ( index <= child->algorithm()->outputDefinitions().size() - 1 )
|
||||||
|
{
|
||||||
|
return child->algorithm()->outputDefinitions().at( index )->type();
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
case Qt::TopEdge:
|
||||||
|
{
|
||||||
|
QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions();
|
||||||
|
|
||||||
|
if ( index <= params.size() - 1 )
|
||||||
|
{
|
||||||
|
return params.at( index )->type();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
case Qt::LeftEdge:
|
||||||
|
case Qt::RightEdge:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor QgsModelComponentGraphicItem::linkColor( Qt::Edge edge, int index ) const
|
||||||
|
{
|
||||||
|
if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast<const QgsProcessingModelChildAlgorithm *>( component() ) )
|
||||||
|
{
|
||||||
|
if ( !child->algorithm() )
|
||||||
|
{
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( edge )
|
||||||
|
{
|
||||||
|
case Qt::BottomEdge:
|
||||||
|
{
|
||||||
|
if ( index <= child->algorithm()->outputDefinitions().size() - 1 )
|
||||||
|
{
|
||||||
|
return child->algorithm()->outputDefinitions().at( index )->modelColor();
|
||||||
|
}
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
case Qt::TopEdge:
|
||||||
|
{
|
||||||
|
QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions();
|
||||||
|
|
||||||
|
if ( index <= params.size() - 1 )
|
||||||
|
{
|
||||||
|
return params.at( index )->modelColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
case Qt::LeftEdge:
|
||||||
|
case Qt::RightEdge:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fallbackColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const
|
QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const
|
||||||
{
|
{
|
||||||
if ( index < 0 )
|
if ( index < 0 )
|
||||||
@ -1099,6 +1231,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
|||||||
|
|
||||||
const QVariantMap inputs = mResults.inputs();
|
const QVariantMap inputs = mResults.inputs();
|
||||||
const QVariantMap outputs = mResults.outputs();
|
const QVariantMap outputs = mResults.outputs();
|
||||||
|
|
||||||
switch ( edge )
|
switch ( edge )
|
||||||
{
|
{
|
||||||
case Qt::BottomEdge:
|
case Qt::BottomEdge:
|
||||||
@ -1115,10 +1248,6 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
|||||||
|
|
||||||
const QgsProcessingOutputDefinition *output = child->algorithm()->outputDefinitions().at( index );
|
const QgsProcessingOutputDefinition *output = child->algorithm()->outputDefinitions().at( index );
|
||||||
QString title = output->description();
|
QString title = output->description();
|
||||||
if ( outputs.contains( output->name() ) )
|
|
||||||
{
|
|
||||||
title += QStringLiteral( ": %1" ).arg( outputs.value( output->name() ).toString() );
|
|
||||||
}
|
|
||||||
return truncatedTextForItem( title );
|
return truncatedTextForItem( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1140,9 +1269,51 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString title = params.at( index )->description();
|
const QgsProcessingParameterDefinition *param = params.at( index );
|
||||||
if ( !inputs.value( params.at( index )->name() ).toString().isEmpty() )
|
QString name = param->name();
|
||||||
title += QStringLiteral( ": %1" ).arg( inputs.value( params.at( index )->name() ).toString() );
|
QString title = param->description();
|
||||||
|
QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name );
|
||||||
|
QString parameterValueAsString;
|
||||||
|
|
||||||
|
if ( paramSources.empty() )
|
||||||
|
{
|
||||||
|
QgsProcessingModelChildParameterSource firstParameterSource = paramSources[0];
|
||||||
|
|
||||||
|
switch ( firstParameterSource.source() )
|
||||||
|
{
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::ChildOutput:
|
||||||
|
parameterValueAsString = QStringLiteral( ": %1" ).arg(
|
||||||
|
firstParameterSource.friendlyIdentifier( const_cast<QgsProcessingModelAlgorithm *>( model() ) )
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::Expression:
|
||||||
|
parameterValueAsString = QStringLiteral( ": %1" ).arg( firstParameterSource.expression() );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::ExpressionText:
|
||||||
|
parameterValueAsString = QStringLiteral( ": %1" ).arg( firstParameterSource.expressionText() );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::ModelOutput:
|
||||||
|
parameterValueAsString = QStringLiteral( ": <%1>" ).arg( firstParameterSource.friendlyIdentifier( const_cast<QgsProcessingModelAlgorithm *>( model() ) ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::ModelParameter:
|
||||||
|
{
|
||||||
|
const QString friendlyName = firstParameterSource.friendlyIdentifier( const_cast<QgsProcessingModelAlgorithm *>( model() ) );
|
||||||
|
parameterValueAsString = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": <%1>" ).arg( friendlyName );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Qgis::ProcessingModelChildParameterSource::StaticValue:
|
||||||
|
default:
|
||||||
|
const QVariant paramValue = paramSources[0].staticValue();
|
||||||
|
parameterValueAsString = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) );
|
||||||
|
}
|
||||||
|
title += parameterValueAsString;
|
||||||
|
}
|
||||||
|
|
||||||
return truncatedTextForItem( title );
|
return truncatedTextForItem( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,8 +137,22 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject
|
|||||||
*/
|
*/
|
||||||
void setItemRect( QRectF rect );
|
void setItemRect( QRectF rect );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the data type of the linked parameter at the specified \a index on the specified \a edge.
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
#ifndef SIP_RUN
|
#ifndef SIP_RUN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the color of the link at the specified \a index on the specified \a edge.
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
virtual QColor linkColor( Qt::Edge edge, int index ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows a preview of setting a new \a rect for the item.
|
* Shows a preview of setting a new \a rect for the item.
|
||||||
*/
|
*/
|
||||||
@ -363,6 +377,13 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject
|
|||||||
*/
|
*/
|
||||||
void updateButtonPositions();
|
void updateButtonPositions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the fallback color if the parameter or output does not have a specific color.
|
||||||
|
*
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
QColor fallbackColor() const { return mFallbackColor; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSizeF itemSize() const;
|
QSizeF itemSize() const;
|
||||||
|
|
||||||
@ -400,6 +421,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject
|
|||||||
|
|
||||||
bool mIsHovering = false;
|
bool mIsHovering = false;
|
||||||
QSizeF mTempSize;
|
QSizeF mTempSize;
|
||||||
|
QColor mFallbackColor = QColor( 128, 128, 128 ); /* mid gray */
|
||||||
};
|
};
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsModelComponentGraphicItem::Flags )
|
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsModelComponentGraphicItem::Flags )
|
||||||
|
|
||||||
@ -427,6 +449,10 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI
|
|||||||
void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override;
|
void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override;
|
||||||
bool canDeleteComponent() override;
|
bool canDeleteComponent() override;
|
||||||
|
|
||||||
|
QString linkedParameterDataType( Qt::Edge, int index ) const override;
|
||||||
|
|
||||||
|
QColor linkColor( Qt::Edge edge, int index ) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QColor fillColor( State state ) const override;
|
QColor fillColor( State state ) const override;
|
||||||
QColor strokeColor( State state ) const override;
|
QColor strokeColor( State state ) const override;
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
#include "qgsmodelgraphicsview.h"
|
#include "qgsmodelgraphicsview.h"
|
||||||
#include "qgsmodelviewtool.h"
|
#include "qgsmodelviewtool.h"
|
||||||
#include "qgsmodelviewmouseevent.h"
|
#include "qgsmodelviewmouseevent.h"
|
||||||
|
#include "qgsprocessingmodelcomponent.h"
|
||||||
|
#include "qgsprocessingoutputs.h"
|
||||||
|
#include "qgsprocessingparameters.h"
|
||||||
|
#include "qgsprocessingmodelchildalgorithm.h"
|
||||||
|
#include "qgsprocessingalgorithm.h"
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QSvgRenderer>
|
#include <QSvgRenderer>
|
||||||
@ -180,13 +185,35 @@ QgsModelDesignerSocketGraphicItem::QgsModelDesignerSocketGraphicItem( QgsModelCo
|
|||||||
|
|
||||||
void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * )
|
void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * )
|
||||||
{
|
{
|
||||||
painter->setPen( QPen() );
|
QColor outlineColor = socketColor();
|
||||||
painter->setBrush( QBrush( QColor( 0, 0, 0, mHoverState ? 200 : 33 ), Qt::SolidPattern ) );
|
QColor fillColor = QColor( outlineColor );
|
||||||
|
|
||||||
|
if ( isInput() )
|
||||||
|
{
|
||||||
|
fillColor.setAlpha( isDefaultParameterValue() ? 30 : 255 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// outputs are always filled sockets
|
||||||
|
fillColor.setAlpha( 255 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outline style
|
||||||
|
painter->setPen( QPen( outlineColor, mHoverState ? mSocketOutlineWidth * 2 : mSocketOutlineWidth ) );
|
||||||
|
|
||||||
|
// Fill style
|
||||||
|
painter->setBrush( QBrush( fillColor, Qt::SolidPattern ) );
|
||||||
|
|
||||||
painter->setRenderHint( QPainter::Antialiasing );
|
painter->setRenderHint( QPainter::Antialiasing );
|
||||||
|
|
||||||
constexpr float DISPLAY_SIZE = 3.2;
|
// Radius of the socket circle
|
||||||
painter->drawEllipse( position(), DISPLAY_SIZE, DISPLAY_SIZE );
|
constexpr float DISPLAY_SIZE = 4;
|
||||||
|
|
||||||
|
// Offset of the socket to separate from the label
|
||||||
|
constexpr float ELLIPSE_OFFSET = 0.4;
|
||||||
|
QPointF ellipsePosition = QPointF( position().x() + ELLIPSE_OFFSET, position().y() + ELLIPSE_OFFSET );
|
||||||
|
painter->drawEllipse( ellipsePosition, DISPLAY_SIZE, DISPLAY_SIZE );
|
||||||
|
|
||||||
/* Uncomment to display bounding box */
|
/* Uncomment to display bounding box */
|
||||||
#if 0
|
#if 0
|
||||||
painter->save();
|
painter->save();
|
||||||
@ -197,4 +224,70 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QColor QgsModelDesignerSocketGraphicItem::socketColor() const
|
||||||
|
{
|
||||||
|
return mComponentItem->linkColor( mEdge, mIndex );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool QgsModelDesignerSocketGraphicItem::isDefaultParameterValue() const
|
||||||
|
{
|
||||||
|
if ( !mComponent )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QgsProcessingModelChildAlgorithm *child = dynamic_cast<const QgsProcessingModelChildAlgorithm *>( mComponent );
|
||||||
|
|
||||||
|
if ( !child )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isDefaultValue = true;
|
||||||
|
|
||||||
|
// We can only know if the socket should be filled if the algorithm is non null
|
||||||
|
if ( child->algorithm() )
|
||||||
|
{
|
||||||
|
switch ( mEdge )
|
||||||
|
{
|
||||||
|
// Input params
|
||||||
|
case Qt::TopEdge:
|
||||||
|
{
|
||||||
|
const QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions();
|
||||||
|
const QgsProcessingParameterDefinition *param = params.value( mIndex );
|
||||||
|
if ( !param )
|
||||||
|
break;
|
||||||
|
|
||||||
|
const QString name = param->name();
|
||||||
|
|
||||||
|
QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name );
|
||||||
|
if ( paramSources.empty() )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The default value can only happen in the case of the parameter uses a static value
|
||||||
|
if ( paramSources[0].source() != Qgis::ProcessingModelChildParameterSource::StaticValue )
|
||||||
|
{
|
||||||
|
isDefaultValue = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
isDefaultValue = paramSources[0].staticValue() == param->defaultValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outputs
|
||||||
|
case Qt::BottomEdge:
|
||||||
|
case Qt::LeftEdge:
|
||||||
|
case Qt::RightEdge:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isDefaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
///@endcond
|
///@endcond
|
||||||
|
@ -201,11 +201,27 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat
|
|||||||
*/
|
*/
|
||||||
QgsModelComponentGraphicItem *componentItem() { return mComponentItem; };
|
QgsModelComponentGraphicItem *componentItem() { return mComponentItem; };
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the color of the socket based on the type of data the param corresponds to.
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
QColor socketColor() const;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns TRUE if the parameter is set to the default parameter value.
|
||||||
|
* \since QGIS 4.0
|
||||||
|
*/
|
||||||
|
bool isDefaultParameterValue() const;
|
||||||
|
signals:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsModelComponentGraphicItem *mComponentItem = nullptr;
|
QgsModelComponentGraphicItem *mComponentItem = nullptr;
|
||||||
QgsProcessingModelComponent *mComponent = nullptr;
|
QgsProcessingModelComponent *mComponent = nullptr;
|
||||||
int mIndex = -1;
|
int mIndex = -1;
|
||||||
Qt::Edge mEdge = Qt::Edge::TopEdge;
|
Qt::Edge mEdge = Qt::Edge::TopEdge;
|
||||||
|
QColor mSocketColor = QColor( 200, 200, 200 );
|
||||||
|
float mSocketOutlineWidth = 1.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
///@endcond
|
///@endcond
|
||||||
|
@ -2996,6 +2996,9 @@ void TestQgsProcessing::parameterBoolean()
|
|||||||
QCOMPARE( def->valueAsPythonString( QVariant(), context ), QStringLiteral( "None" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant(), context ), QStringLiteral( "None" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( true ) ), QString( "true" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( false ) ), QString( "false" ) );
|
||||||
|
|
||||||
QString pythonCode = def->asPythonString();
|
QString pythonCode = def->asPythonString();
|
||||||
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterBoolean('non_optional_default_false', '', defaultValue=None)" ) );
|
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterBoolean('non_optional_default_false', '', defaultValue=None)" ) );
|
||||||
|
|
||||||
@ -3211,6 +3214,8 @@ void TestQgsProcessing::parameterCrs()
|
|||||||
QVERIFY( def->checkValueIsAcceptable( QgsProcessingFeatureSourceDefinition( QgsProperty::fromValue( QVariant::fromValue( r1 ) ) ) ) );
|
QVERIFY( def->checkValueIsAcceptable( QgsProcessingFeatureSourceDefinition( QgsProperty::fromValue( QVariant::fromValue( r1 ) ) ) ) );
|
||||||
QVERIFY( def->checkValueIsAcceptable( QgsProcessingOutputLayerDefinition( r1->id() ) ) );
|
QVERIFY( def->checkValueIsAcceptable( QgsProcessingOutputLayerDefinition( r1->id() ) ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( "EPSG:3857" ) ), QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3857" ) ).userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) );
|
||||||
|
|
||||||
// using map layer
|
// using map layer
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
params.insert( "non_optional", v1->id() );
|
params.insert( "non_optional", v1->id() );
|
||||||
@ -3870,6 +3875,10 @@ void TestQgsProcessing::parameterExtent()
|
|||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsReferencedRectangle( QgsRectangle( 11, 12, 13, 14 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] Polygon" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsRectangle( 11, 12, 13, 14 ) ), QStringLiteral( "Polygon" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( "1,2,3,4" ) ), QStringLiteral( "1,2,3,4" ) );
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() );
|
QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() );
|
||||||
QVERIFY( ok );
|
QVERIFY( ok );
|
||||||
@ -4111,6 +4120,12 @@ void TestQgsProcessing::parameterPoint()
|
|||||||
QCOMPARE( def->valueAsJsonObject( QgsReferencedPointXY( QgsPointXY( 11, 12 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ), context ), QVariant( QStringLiteral( "11,12 [EPSG:4326]" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QgsReferencedPointXY( QgsPointXY( 11, 12 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ), context ), QVariant( QStringLiteral( "11,12 [EPSG:4326]" ) ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsReferencedPointXY( QgsPointXY( 11, 12 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] 11, 12" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsPointXY( 11, 12 ) ), QStringLiteral( "11, 12" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsReferencedPointXY( QgsPointXY( 11.1, 12.2 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] 11.1, 12.2" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsPointXY( 11.1, 12.2 ) ), QStringLiteral( "11.1, 12.2" ) );
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() );
|
QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() );
|
||||||
QVERIFY( ok );
|
QVERIFY( ok );
|
||||||
@ -4326,6 +4341,10 @@ void TestQgsProcessing::parameterGeometry()
|
|||||||
// With Srid as string
|
// With Srid as string
|
||||||
QCOMPARE( def->valueAsPythonString( QgsReferencedGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), QgsCoordinateReferenceSystem( "EPSG:4326" ) ), context ), QStringLiteral( "'CRS=EPSG:4326;LineString (10 10, 20 20)'" ) );
|
QCOMPARE( def->valueAsPythonString( QgsReferencedGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), QgsCoordinateReferenceSystem( "EPSG:4326" ) ), context ), QStringLiteral( "'CRS=EPSG:4326;LineString (10 10, 20 20)'" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsGeometry::fromWkt( QStringLiteral( "Polygon ((11.1 12.2, 13.3 12.2, 13.3 14.4, 11.1 14.4, 11.1 12.2))" ) ) ), QStringLiteral( "Polygon" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QgsReferencedGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), QgsCoordinateReferenceSystem( "EPSG:4326" ) ) ), QStringLiteral( "[EPSG:4326] Line" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QStringLiteral( "Polygon ((11.1 12.2, 13.3 12.2, 13.3 14.4, 11.1 14.4, 11.1 12.2))" ) ), QStringLiteral( "Polygon" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( "LineString( 10 10, 20 20)", context ), QVariant( QStringLiteral( "LineString( 10 10, 20 20)" ) ) );
|
QCOMPARE( def->valueAsJsonObject( "LineString( 10 10, 20 20)", context ), QVariant( QStringLiteral( "LineString( 10 10, 20 20)" ) ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) );
|
||||||
@ -4505,6 +4524,8 @@ void TestQgsProcessing::parameterFile()
|
|||||||
QCOMPARE( def->valueAsJsonObject( "uri='complex' username=\"complex\"", context ), QVariant( QStringLiteral( "uri='complex' username=\"complex\"" ) ) );
|
QCOMPARE( def->valueAsJsonObject( "uri='complex' username=\"complex\"", context ), QVariant( QStringLiteral( "uri='complex' username=\"complex\"" ) ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( "bricks.bmp" ), QStringLiteral( "bricks.bmp" ) );
|
||||||
|
|
||||||
const QString testDataDir = QStringLiteral( TEST_DATA_DIR ) + '/'; //defined in CmakeLists.txt
|
const QString testDataDir = QStringLiteral( TEST_DATA_DIR ) + '/'; //defined in CmakeLists.txt
|
||||||
// ensure valueAsJsonObject doesn't try to load a file path as a layer
|
// ensure valueAsJsonObject doesn't try to load a file path as a layer
|
||||||
QCOMPARE( context.temporaryLayerStore()->count(), 0 );
|
QCOMPARE( context.temporaryLayerStore()->count(), 0 );
|
||||||
@ -5256,6 +5277,8 @@ void TestQgsProcessing::parameterDistance()
|
|||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 ft" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
||||||
@ -5371,6 +5394,7 @@ void TestQgsProcessing::parameterArea()
|
|||||||
QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) );
|
QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 square feet" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
||||||
@ -5487,6 +5511,7 @@ void TestQgsProcessing::parameterVolume()
|
|||||||
QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) );
|
QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 cubic feet" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
||||||
@ -5600,6 +5625,8 @@ void TestQgsProcessing::parameterDuration()
|
|||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 d" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
||||||
@ -5703,6 +5730,8 @@ void TestQgsProcessing::parameterScale()
|
|||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
||||||
@ -5822,6 +5851,8 @@ void TestQgsProcessing::parameterNumber()
|
|||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) );
|
||||||
@ -6443,6 +6474,10 @@ void TestQgsProcessing::parameterEnum()
|
|||||||
QCOMPARE( def->valueAsPythonComment( QVariantList() << 1 << 2, context ), QStringLiteral( "B,C" ) );
|
QCOMPARE( def->valueAsPythonComment( QVariantList() << 1 << 2, context ), QStringLiteral( "B,C" ) );
|
||||||
QCOMPARE( def->valueAsPythonComment( QStringLiteral( "1,2" ), context ), QStringLiteral( "B,C" ) );
|
QCOMPARE( def->valueAsPythonComment( QStringLiteral( "1,2" ), context ), QStringLiteral( "B,C" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 0 ) ), QString( "A" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 1 ) ), QString( "B" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( 2 ) ), QString( "C" ) );
|
||||||
|
|
||||||
pythonCode = def->asPythonString();
|
pythonCode = def->asPythonString();
|
||||||
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterEnum('non_optional', '', options=['A','B','C'], allowMultiple=True, usesStaticStrings=False, defaultValue=5)" ) );
|
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterEnum('non_optional', '', options=['A','B','C'], allowMultiple=True, usesStaticStrings=False, defaultValue=5)" ) );
|
||||||
|
|
||||||
@ -6694,6 +6729,8 @@ void TestQgsProcessing::parameterString()
|
|||||||
QCOMPARE( def->valueAsPythonString( "uri='complex' username=\"complex\"", context ), QStringLiteral( "'uri=\\'complex\\' username=\"complex\"'" ) );
|
QCOMPARE( def->valueAsPythonString( "uri='complex' username=\"complex\"", context ), QStringLiteral( "'uri=\\'complex\\' username=\"complex\"'" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QStringLiteral( "'c:\\\\test\\\\new data\\\\test.dat'" ) );
|
QCOMPARE( def->valueAsPythonString( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QStringLiteral( "'c:\\\\test\\\\new data\\\\test.dat'" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QVariant( "Hello" ) ), QStringLiteral( "Hello" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "abc" ), context ), QVariant( QStringLiteral( "abc" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "abc" ), context ), QVariant( QStringLiteral( "abc" ) ) );
|
||||||
@ -9711,6 +9748,8 @@ void TestQgsProcessing::parameterColor()
|
|||||||
QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0 ), context ), QStringLiteral( "QColor(255, 0, 0)" ) );
|
QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0 ), context ), QStringLiteral( "QColor(255, 0, 0)" ) );
|
||||||
QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0, 100 ), context ), QStringLiteral( "QColor(255, 0, 0, 100)" ) );
|
QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0, 100 ), context ), QStringLiteral( "QColor(255, 0, 0, 100)" ) );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QColor( 255, 0, 0 ) ), QStringLiteral( "#ff0000" ) );
|
||||||
|
|
||||||
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() );
|
||||||
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "#ff0000" ), context ), QVariant( QStringLiteral( "#ff0000" ) ) );
|
QCOMPARE( def->valueAsJsonObject( QStringLiteral( "#ff0000" ), context ), QVariant( QStringLiteral( "#ff0000" ) ) );
|
||||||
QCOMPARE( def->valueAsJsonObject( QColor(), context ), QVariant( QString() ) );
|
QCOMPARE( def->valueAsJsonObject( QColor(), context ), QVariant( QString() ) );
|
||||||
@ -11174,6 +11213,10 @@ void TestQgsProcessing::parameterDateTime()
|
|||||||
QCOMPARE( def->valueAsString( QDate( 2014, 12, 31 ), context, ok ), QStringLiteral( "2014-12-31" ) );
|
QCOMPARE( def->valueAsString( QDate( 2014, 12, 31 ), context, ok ), QStringLiteral( "2014-12-31" ) );
|
||||||
QVERIFY( ok );
|
QVERIFY( ok );
|
||||||
|
|
||||||
|
QCOMPARE( def->userFriendlyString( QDate( 2014, 12, 31 ) ), QStringLiteral( "2014-12-31" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QTime( 12, 11, 10 ) ), QStringLiteral( "12:11:10" ) );
|
||||||
|
QCOMPARE( def->userFriendlyString( QDateTime( QDate( 2014, 12, 31 ), QTime( 12, 11, 10 ) ) ), QStringLiteral( "2014-12-31T12:11:10" ) );
|
||||||
|
|
||||||
pythonCode = def->asPythonString();
|
pythonCode = def->asPythonString();
|
||||||
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterDateTime('non_optional', '', type=QgsProcessingParameterDateTime.Date, minValue=QDateTime(QDate(2015, 1, 1), QTime(0, 0, 0)), maxValue=QDateTime(QDate(2015, 12, 31), QTime(0, 0, 0)), defaultValue=QDate(2010, 4, 3))" ) );
|
QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterDateTime('non_optional', '', type=QgsProcessingParameterDateTime.Date, minValue=QDateTime(QDate(2015, 1, 1), QTime(0, 0, 0)), maxValue=QDateTime(QDate(2015, 12, 31), QTime(0, 0, 0)), defaultValue=QDate(2010, 4, 3))" ) );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user