mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
qt: Get rid of cursor in out-of-focus labels
This change is a temporary fix of QTBUG-59514.
This commit is contained in:
@@ -450,6 +450,28 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
|
||||
return QObject::eventFilter(obj, evt);
|
||||
}
|
||||
|
||||
LabelOutOfFocusEventFilter::LabelOutOfFocusEventFilter(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool LabelOutOfFocusEventFilter::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::FocusOut) {
|
||||
auto focus_out = static_cast<QFocusEvent*>(event);
|
||||
if (focus_out->reason() != Qt::PopupFocusReason) {
|
||||
auto label = qobject_cast<QLabel*>(watched);
|
||||
if (label) {
|
||||
auto flags = label->textInteractionFlags();
|
||||
label->setTextInteractionFlags(Qt::NoTextInteraction);
|
||||
label->setTextInteractionFlags(flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void TableViewLastColumnResizingFixer::connectViewHeadersSignals()
|
||||
{
|
||||
connect(tableView->horizontalHeader(), &QHeaderView::sectionResized, this, &TableViewLastColumnResizingFixer::on_sectionResized);
|
||||
|
||||
Reference in New Issue
Block a user