MCPcopy Create free account
hub / github.com/ElementsProject/elements / eventFilter

Method eventFilter

src/qt/guiutil.cpp:471–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
472{
473 if(evt->type() == QEvent::ToolTipChange)
474 {
475 QWidget *widget = static_cast<QWidget*>(obj);
476 QString tooltip = widget->toolTip();
477 if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt") && !Qt::mightBeRichText(tooltip))
478 {
479 // Envelop with <qt></qt> to make sure Qt detects this as rich text
480 // Escape the current message as HTML and replace \n by <br>
481 tooltip = "<qt>" + HtmlEscape(tooltip, true) + "</qt>";
482 widget->setToolTip(tooltip);
483 return true;
484 }
485 }
486 return QObject::eventFilter(obj, evt);
487}
488
489LabelOutOfFocusEventFilter::LabelOutOfFocusEventFilter(QObject* parent)
490 : QObject(parent)

Callers

nothing calls this directly

Calls 4

HtmlEscapeFunction · 0.85
typeMethod · 0.80
sizeMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected