Skip to content

Commit 2ef99da

Browse files
committedApr 2, 2019
legend: truncate excessively long tooltips (fixes #21737)
1 parent c638255 commit 2ef99da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/core/layertree/qgslayertreemodel.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,13 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
330330
parts << QString();
331331
}
332332

333-
parts << "<i>" + layer->publicSource().toHtmlEscaped() + "</i>";
333+
QString source( layer->publicSource() );
334+
if ( source.size() > 1024 )
335+
{
336+
source = source.left( 1023 ) + QStringLiteral( "" );
337+
}
338+
339+
parts << "<i>" + source.toHtmlEscaped() + "</i>";
334340

335341
return parts.join( QStringLiteral( "<br/>" ) );
336342
}

0 commit comments

Comments
 (0)
Please sign in to comment.