Prevent tooltip filter from ever causing infinite loops

This commit is contained in:
Wladimir J. van der Laan 2012-05-12 12:47:50 +02:00
parent df1a110d2e
commit 99fdc1d829
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
{
QWidget *widget = static_cast<QWidget*>(obj);
QString tooltip = widget->toolTip();
if(!Qt::mightBeRichText(tooltip) && tooltip.size() > size_threshold)
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip))
{
// Prefix <qt/> to make sure Qt detects this as rich text
// Escape the current message as HTML and replace \n by <br>