mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
legend: truncate excessively long tooltips (fixes #21737)
This commit is contained in:
parent
c6382553cd
commit
2ef99da242
@ -330,7 +330,13 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
|
||||
parts << QString();
|
||||
}
|
||||
|
||||
parts << "<i>" + layer->publicSource().toHtmlEscaped() + "</i>";
|
||||
QString source( layer->publicSource() );
|
||||
if ( source.size() > 1024 )
|
||||
{
|
||||
source = source.left( 1023 ) + QStringLiteral( "…" );
|
||||
}
|
||||
|
||||
parts << "<i>" + source.toHtmlEscaped() + "</i>";
|
||||
|
||||
return parts.join( QStringLiteral( "<br/>" ) );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user