Skip to content
Permalink
Browse files
Improve representation of long strings
  • Loading branch information
m-kuhn committed Nov 20, 2021
1 parent ee255af commit 9f547515fc1d8d6c23ab99e85f606bc4bdb230c0
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/qgsfield.cpp
@@ -266,11 +266,12 @@ QString QgsField::displayString( const QVariant &v ) const
return QgsApplication::nullRepresentation();
else
{
QString formattedText = QStringLiteral( "%1 [%2]" ).arg( geom.asWkt(), geom.crs().userFriendlyIdentifier() );
if ( formattedText.length() >= 1050 )
QString wkt = geom.asWkt();
if ( wkt.length() >= 1050 )
{
formattedText = formattedText.left( 999 ) + QChar( 0x2026 );
wkt = wkt.left( 999 ) + QChar( 0x2026 );
}
QString formattedText = QStringLiteral( "%1 [%2]" ).arg( wkt, geom.crs().userFriendlyIdentifier() );
return formattedText;
}
}

0 comments on commit 9f54751

Please sign in to comment.