mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
wkt encoded geometries now display geom type in graphic item
This commit is contained in:
parent
b29f446c7c
commit
17b26806d6
@ -76,7 +76,7 @@ except (NameError, AttributeError):
|
||||
try:
|
||||
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
||||
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
||||
QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||
QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||
QgsProcessingParameterCrs.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -131,7 +131,7 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
||||
QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||
QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||
QgsProcessingParameterDistance.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -177,7 +177,7 @@ except (NameError, AttributeError):
|
||||
try:
|
||||
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
||||
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
||||
QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', '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']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -383,7 +383,7 @@ try:
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', '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.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
|
@ -369,7 +369,7 @@ Constructor for QgsProcessingParameterDefinition.
|
||||
A color to represent the default parameter
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
%Docstring
|
||||
Returns a user-friendly string representation of the provided parameter
|
||||
``value``.
|
||||
@ -377,7 +377,7 @@ Returns a user-friendly string representation of the provided parameter
|
||||
The returned string is to be used for display purposes only, and should
|
||||
be translated as required.
|
||||
|
||||
.. versionadded:: 3.44
|
||||
.. versionadded:: 4.0
|
||||
%End
|
||||
|
||||
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
||||
@ -1936,12 +1936,8 @@ A coordinate reference system parameter for processing algorithms.
|
||||
Constructor for QgsProcessingParameterCrs.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
%Docstring
|
||||
Get a user friendly string representation of the provided parameter
|
||||
value.
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -2571,7 +2567,7 @@ Constructor for QgsProcessingParameterDistance.
|
||||
Returns the type name for the parameter class.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
|
||||
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
||||
@ -3043,12 +3039,8 @@ values.
|
||||
Constructor for QgsProcessingParameterEnum.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
%Docstring
|
||||
Get a user friendly string representation of the provided parameter
|
||||
value.
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
|
@ -76,7 +76,7 @@ except (NameError, AttributeError):
|
||||
try:
|
||||
QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName)
|
||||
QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode)
|
||||
QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||
QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject']
|
||||
QgsProcessingParameterCrs.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -131,7 +131,7 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName)
|
||||
QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||
QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap']
|
||||
QgsProcessingParameterDistance.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -177,7 +177,7 @@ except (NameError, AttributeError):
|
||||
try:
|
||||
QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName)
|
||||
QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode)
|
||||
QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', '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']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -383,7 +383,7 @@ try:
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', '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.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
|
@ -369,7 +369,7 @@ Constructor for QgsProcessingParameterDefinition.
|
||||
A color to represent the default parameter
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
%Docstring
|
||||
Returns a user-friendly string representation of the provided parameter
|
||||
``value``.
|
||||
@ -377,7 +377,7 @@ Returns a user-friendly string representation of the provided parameter
|
||||
The returned string is to be used for display purposes only, and should
|
||||
be translated as required.
|
||||
|
||||
.. versionadded:: 3.44
|
||||
.. versionadded:: 4.0
|
||||
%End
|
||||
|
||||
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
|
||||
@ -1936,12 +1936,8 @@ A coordinate reference system parameter for processing algorithms.
|
||||
Constructor for QgsProcessingParameterCrs.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
%Docstring
|
||||
Get a user friendly string representation of the provided parameter
|
||||
value.
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -2571,7 +2567,7 @@ Constructor for QgsProcessingParameterDistance.
|
||||
Returns the type name for the parameter class.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
|
||||
virtual QgsProcessingParameterDistance *clone() const /Factory/;
|
||||
@ -3043,12 +3039,8 @@ values.
|
||||
Constructor for QgsProcessingParameterEnum.
|
||||
%End
|
||||
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
%Docstring
|
||||
Get a user friendly string representation of the provided parameter
|
||||
value.
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
|
@ -3032,18 +3032,18 @@ QColor QgsProcessingParameterDefinition::modelColor() const
|
||||
return QgsProcessingParameterType::defaultModelColor();
|
||||
}
|
||||
|
||||
QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramValue ) const
|
||||
QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) const
|
||||
{
|
||||
if ( paramValue.userType() == qMetaTypeId<QgsPointXY>() )
|
||||
if ( value.userType() == qMetaTypeId<QgsPointXY>() )
|
||||
{
|
||||
const QgsPointXY r = paramValue.value<QgsPointXY>();
|
||||
const QgsPointXY r = value.value<QgsPointXY>();
|
||||
return QStringLiteral( "%1, %2" ).arg( qgsDoubleToString( r.x(), 4 ),
|
||||
qgsDoubleToString( r.y(), 4 ) );
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == qMetaTypeId<QgsReferencedPointXY>() )
|
||||
else if ( value.userType() == qMetaTypeId<QgsReferencedPointXY>() )
|
||||
{
|
||||
const QgsReferencedPointXY r = paramValue.value<QgsReferencedPointXY>();
|
||||
const QgsReferencedPointXY r = value.value<QgsReferencedPointXY>();
|
||||
return QStringLiteral( "[%1] %1, %3" ).arg(
|
||||
r.crs().authid(),
|
||||
qgsDoubleToString( r.x() ),
|
||||
@ -3051,43 +3051,41 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa
|
||||
);
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == qMetaTypeId< QgsGeometry>() )
|
||||
else if ( value.userType() == qMetaTypeId< QgsGeometry>() )
|
||||
{
|
||||
const QgsGeometry g = paramValue.value<QgsGeometry>();
|
||||
const QgsGeometry g = value.value<QgsGeometry>();
|
||||
return g.typeName();
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == qMetaTypeId<QgsReferencedGeometry>() )
|
||||
else if ( value.userType() == qMetaTypeId<QgsReferencedGeometry>() )
|
||||
{
|
||||
const QgsReferencedGeometry g = paramValue.value<QgsReferencedGeometry>();
|
||||
const QgsReferencedGeometry g = value.value<QgsReferencedGeometry>();
|
||||
if ( !g.isNull() )
|
||||
{
|
||||
const QString wkt = g.asWkt();
|
||||
return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() );
|
||||
}
|
||||
return g.typeName();
|
||||
}
|
||||
|
||||
if ( paramValue.userType() == qMetaTypeId<QgsRectangle>() )
|
||||
if ( value.userType() == qMetaTypeId<QgsRectangle>() )
|
||||
{
|
||||
const QgsGeometry g = QgsGeometry::fromRect( paramValue.value<QgsRectangle>() );
|
||||
const QgsGeometry g = QgsGeometry::fromRect( value.value<QgsRectangle>() );
|
||||
return g.typeName();
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == qMetaTypeId<QgsReferencedRectangle>() )
|
||||
else if ( value.userType() == qMetaTypeId<QgsReferencedRectangle>() )
|
||||
{
|
||||
const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( paramValue.value<QgsReferencedRectangle>() );
|
||||
const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( value.value<QgsReferencedRectangle>() );
|
||||
if ( !g.isNull() )
|
||||
{
|
||||
const QString wkt = g.asWkt();
|
||||
return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() );
|
||||
}
|
||||
return g.typeName();
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == qMetaTypeId<QgsProcessingOutputLayerDefinition>() )
|
||||
else if ( value.userType() == qMetaTypeId<QgsProcessingOutputLayerDefinition>() )
|
||||
{
|
||||
const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( paramValue );
|
||||
const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( value );
|
||||
if ( fromVar.sink.propertyType() == Qgis::PropertyType::Static )
|
||||
{
|
||||
return fromVar.sink.staticValue().toString();
|
||||
@ -3097,9 +3095,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa
|
||||
return fromVar.sink.asExpression();
|
||||
}
|
||||
}
|
||||
else if ( paramValue.userType() == QMetaType::Type::QDateTime )
|
||||
else if ( value.userType() == QMetaType::Type::QDateTime )
|
||||
{
|
||||
const QDateTime dt = paramValue.toDateTime();
|
||||
const QDateTime dt = value.toDateTime();
|
||||
if ( !dt.isValid() )
|
||||
return QStringLiteral( "invalid datetime" );
|
||||
else
|
||||
@ -3112,9 +3110,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa
|
||||
.arg( dt.time().second() );
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == QMetaType::Type::QDate )
|
||||
else if ( value.userType() == QMetaType::Type::QDate )
|
||||
{
|
||||
const QDate dt = paramValue.toDate();
|
||||
const QDate dt = value.toDate();
|
||||
if ( !dt.isValid() )
|
||||
return QStringLiteral( "invalid date" );
|
||||
else
|
||||
@ -3124,9 +3122,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa
|
||||
.arg( dt.day() );
|
||||
}
|
||||
|
||||
else if ( paramValue.userType() == QMetaType::Type::QTime )
|
||||
else if ( value.userType() == QMetaType::Type::QTime )
|
||||
{
|
||||
const QTime dt = paramValue.toTime();
|
||||
const QTime dt = value.toTime();
|
||||
if ( !dt.isValid() )
|
||||
return QStringLiteral( "invalid time" );
|
||||
else
|
||||
@ -3136,7 +3134,18 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa
|
||||
.arg( dt.second() );
|
||||
}
|
||||
|
||||
return paramValue.toString();
|
||||
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 g.typeName();
|
||||
}
|
||||
}
|
||||
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const
|
||||
@ -3298,9 +3307,9 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr
|
||||
return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional );
|
||||
}
|
||||
|
||||
QString QgsProcessingParameterCrs::getUserFriendlyValue( QVariant paramValue ) const
|
||||
QString QgsProcessingParameterCrs::userFriendlyString( QVariant &value ) const
|
||||
{
|
||||
return paramValue.value<QgsCoordinateReferenceSystem>().authid();
|
||||
return value.value<QgsCoordinateReferenceSystem>().authid();
|
||||
}
|
||||
|
||||
QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList<int> &types )
|
||||
@ -5391,9 +5400,9 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString QgsProcessingParameterEnum::getUserFriendlyValue( QVariant paramValue ) const
|
||||
QString QgsProcessingParameterEnum::userFriendlyString( QVariant &value ) const
|
||||
{
|
||||
return options().at( paramValue.toInt() );
|
||||
return options().at( value.toInt() );
|
||||
}
|
||||
|
||||
QStringList QgsProcessingParameterEnum::options() const
|
||||
@ -7858,9 +7867,9 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map )
|
||||
}
|
||||
|
||||
|
||||
QString QgsProcessingParameterDistance::getUserFriendlyValue( QVariant paramValue ) const
|
||||
QString QgsProcessingParameterDistance::userFriendlyString( QVariant &value ) const
|
||||
{
|
||||
return QStringLiteral( "%1 %2" ).arg( paramValue.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||
return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -470,9 +470,9 @@ class CORE_EXPORT QgsProcessingParameterDefinition
|
||||
* 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 3.44
|
||||
* \since QGIS 4.0
|
||||
*/
|
||||
virtual QString getUserFriendlyValue( QVariant paramValue ) const;
|
||||
virtual QString userFriendlyString( QVariant &value ) const;
|
||||
|
||||
/**
|
||||
* Creates a clone of the parameter definition.
|
||||
@ -1826,10 +1826,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin
|
||||
QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
|
||||
bool optional = false );
|
||||
|
||||
/**
|
||||
* Get a user friendly string representation of the provided parameter value.
|
||||
*/
|
||||
QString getUserFriendlyValue( QVariant paramValue ) const override;
|
||||
QString userFriendlyString( QVariant &value ) const override;
|
||||
|
||||
/**
|
||||
* Returns the type name for the parameter class.
|
||||
@ -2381,7 +2378,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember
|
||||
|
||||
QString getUserFriendlyValue( QVariant paramValue ) const override;
|
||||
QString userFriendlyString( QVariant &value ) const override;
|
||||
|
||||
QgsProcessingParameterDistance *clone() const override SIP_FACTORY;
|
||||
|
||||
@ -2803,10 +2800,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi
|
||||
bool optional = false,
|
||||
bool usesStaticStrings = false );
|
||||
|
||||
/**
|
||||
* Get a user friendly string representation of the provided parameter value.
|
||||
*/
|
||||
QString getUserFriendlyValue( QVariant paramValue ) const override;
|
||||
QString userFriendlyString( QVariant &value ) const override;
|
||||
|
||||
/**
|
||||
* Returns the type name for the parameter class.
|
||||
|
@ -847,7 +847,6 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) )
|
||||
{
|
||||
QString text = this->model()->parameterDefinition( parameter->parameterName() )->type();
|
||||
@ -859,14 +858,12 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const
|
||||
|
||||
if ( paramValue.isValid() )
|
||||
{
|
||||
text += ": " + paramDef->getUserFriendlyValue( paramValue );
|
||||
text += ": " + paramDef->userFriendlyString( paramValue );
|
||||
}
|
||||
}
|
||||
|
||||
return truncatedTextForItem( text );
|
||||
}
|
||||
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
@ -1316,7 +1313,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
||||
case Qgis::ProcessingModelChildParameterSource::StaticValue:
|
||||
default:
|
||||
QVariant paramValue = paramSources[0].staticValue();
|
||||
paramValueAsStr = QStringLiteral( ": %1" ).arg( param->getUserFriendlyValue( paramValue ) );
|
||||
paramValueAsStr = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) );
|
||||
}
|
||||
title += paramValueAsStr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user