The text selection should not be cleared when the focus
out event received has one the following reasons:
- Qt::ActiveWindowFocusReason
- Qt::PopupFocusReason
When the user opens a menu or navigates to another window,
the eventual selection should not be clearer.
This also makes the behavior consistent with TextEdit.
Change-Id: Ibc6242cb2f8207cf5281925c8e20b88394f21eea
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
updatePasswordEchoEditing(false);//QQuickTextInputPrivate sets it on key events, but doesn't deal with focus events
}
- if (!persistentSelection)
+ if (event->reason() != Qt::ActiveWindowFocusReason
+ && event->reason() != Qt::PopupFocusReason
+ && hasSelectedText()
+ && !persistentSelection)
deselect();
#ifndef QT_NO_IM