From 42b69b1383375a52818758bf89198e8dc97902d3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 9 Mar 2010 15:39:40 +0100 Subject: Cursor would remain in a non-focused QLineEdit after clearing its selection QLineEditPrivate::_q_selectionChanged() did not take into account whether the widget had focus. Reviewed-by: Olivier Task-number: QTBUG-8634 --- src/gui/widgets/qlineedit_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 2c76a5c..468c111 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -134,7 +134,7 @@ void QLineEditPrivate::_q_selectionChanged() q->initStyleOption(&opt); bool showCursor = control->hasSelectedText() ? q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q): - true; + q->hasFocus(); setCursorVisible(showCursor); } -- cgit v0.12