MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / eventFilter

Method eventFilter

src/qt/guiutil.cpp:469–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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