After clicking on QLabel with selectable text the cursor remains forever:

This PR fixes this visual bug.
Earlier attempts to fix this issue:
Concept ACK, multiple cursors visible is wtf-level confusing.
Should this be reported as an upstream issue too?
458 | +bool LabelOutOfFocusEventFilter::eventFilter(QObject* watched, QEvent* event) 459 | +{ 460 | + if (event->type() == QEvent::FocusOut) { 461 | + QLabel* label = qobject_cast<QLabel*>(watched); 462 | + if (label) { 463 | + const QString content = label->text();
This also works
auto flags = label->textInteractionFlags();
label->setTextInteractionFlags(Qt::NoTextInteraction);
label->setTextInteractionFlags(flags);
Concept ACK. Tested this approach and the one I'm suggesting. Does it make sense to have a dedicated label subclass?
This seems ugly. Ideally, if the focus returns to the label, the cursor position shouldn't be lost.
Should this be reported as an upstream issue too?
Updated 4b7c95324f40738185f52da161d144f6e9f0c484 -> 5dbe2d60a83c06d550f104d79e1b9c82e49c7008 (pr19210.01 -> pr19210.02, diff):
This also works
555 | @@ -556,6 +556,9 @@ int GuiMain(int argc, char* argv[]) 556 | /// 9. Main GUI initialization 557 | // Install global event filter that makes sure that long tooltips can be word-wrapped 558 | app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); 559 | + // Install global event filter that makes sure that out-of-focus labels do not contain text cursor. 560 | + // This is a temporary fix of QTBUG-59514.
nit, move/copy this comment to class doc.
Code review ACK 5dbe2d60a83c06d550f104d79e1b9c82e49c7008.
This change is a temporary fix of QTBUG-59514.
Updated 5dbe2d60a83c06d550f104d79e1b9c82e49c7008 -> bd315eb5e27d49d47759ae9417328427426cb269 (pr19210.02 -> pr19210.03, diff):
nit, move/copy this comment to class doc
Code review ACK bd315eb5e27d49d47759ae9417328427426cb269.
Tested ACK bd315eb5e27d49d47759ae9417328427426cb269