Cleanup metatype conversion

This commit is contained in:
Nyall Dawson 2024-05-31 08:54:10 +10:00 committed by Julien Cabieces
parent b43537680c
commit d269eb03b7
2 changed files with 4 additions and 4 deletions

View File

@ -130,8 +130,8 @@ void QgsProcessingAggregatePanelWidget::setValue( const QVariant &value )
{
const QVariantMap map = field.toMap();
const QgsField f( map.value( QStringLiteral( "name" ) ).toString(),
static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), QgsVariantUtils::createNullVariant( QMetaType::Type::UnknownType ) ).toInt() ),
map.value( QStringLiteral( "type_name" ), QVariant::typeToName( static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), QgsVariantUtils::createNullVariant( QMetaType::Type::UnknownType ) ).toInt() ) ) ).toString(),
static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), static_cast< int >( QMetaType::Type::UnknownType ) ).toInt() ),
map.value( QStringLiteral( "type_name" ), QVariant::typeToName( static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), static_cast< int >( QMetaType::Type::UnknownType ) ).toInt() ) ) ).toString(),
map.value( QStringLiteral( "length" ), 0 ).toInt(),
map.value( QStringLiteral( "precision" ), 0 ).toInt(),
QString(),

View File

@ -133,8 +133,8 @@ void QgsProcessingFieldMapPanelWidget::setValue( const QVariant &value )
{
const QVariantMap map = field.toMap();
QgsField f( map.value( QStringLiteral( "name" ) ).toString(),
static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), QgsVariantUtils::createNullVariant( QMetaType::Type::UnknownType ) ).toInt() ),
map.value( QStringLiteral( "type_name" ), QVariant::typeToName( static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), QgsVariantUtils::createNullVariant( QMetaType::Type::UnknownType ) ).toInt() ) ) ).toString(),
static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), static_cast< int >( QMetaType::Type::UnknownType ) ).toInt() ),
map.value( QStringLiteral( "type_name" ), QVariant::typeToName( static_cast< QMetaType::Type >( map.value( QStringLiteral( "type" ), static_cast< int >( QMetaType::Type::UnknownType ) ).toInt() ) ) ).toString(),
map.value( QStringLiteral( "length" ), 0 ).toInt(),
map.value( QStringLiteral( "precision" ), 0 ).toInt(),
QString(),