| 390 | } |
| 391 | |
| 392 | bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) |
| 393 | { |
| 394 | if(evt->type() == QEvent::ToolTipChange) |
| 395 | { |
| 396 | QWidget *widget = static_cast<QWidget*>(obj); |
| 397 | QString tooltip = widget->toolTip(); |
| 398 | if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt") && !Qt::mightBeRichText(tooltip)) |
| 399 | { |
| 400 | // Envelop with <qt></qt> to make sure Qt detects this as rich text |
| 401 | // Escape the current message as HTML and replace \n by <br> |
| 402 | tooltip = "<qt>" + HtmlEscape(tooltip, true) + "</qt>"; |
| 403 | widget->setToolTip(tooltip); |
| 404 | return true; |
| 405 | } |
| 406 | } |
| 407 | return QObject::eventFilter(obj, evt); |
| 408 | } |
| 409 | |
| 410 | void TableViewLastColumnResizingFixer::connectViewHeadersSignals() |
| 411 | { |
nothing calls this directly
no test coverage detected