Skip to content

Commit

Permalink
legend: truncate excessively long tooltips (fixes #21737)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 2, 2019
1 parent c638255 commit 2ef99da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -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/>" ) );
}
Expand Down

0 comments on commit 2ef99da

Please sign in to comment.