From bd315eb5e27d49d47759ae9417328427426cb269 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 8 Jun 2020 16:48:45 +0300 Subject: qt: Get rid of cursor in out-of-focus labels This change is a temporary fix of QTBUG-59514. --- src/qt/guiutil.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/qt/guiutil.h') diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 8741d90102..2bd94b5eb3 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -161,6 +161,21 @@ namespace GUIUtil int size_threshold; }; + /** + * Qt event filter that intercepts QEvent::FocusOut events for QLabel objects, and + * resets their `textInteractionFlags' property to get rid of the visible cursor. + * + * This is a temporary fix of QTBUG-59514. + */ + class LabelOutOfFocusEventFilter : public QObject + { + Q_OBJECT + + public: + explicit LabelOutOfFocusEventFilter(QObject* parent); + bool eventFilter(QObject* watched, QEvent* event) override; + }; + /** * Makes a QTableView last column feel as if it was being resized from its left border. * Also makes sure the column widths are never larger than the table's viewport. -- cgit v1.2.3