Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.5.1, 5.9.2
-
None
-
ArchLinux
qt-base 5.9.2Ubuntu 16.04
qt-base 5.5.1
Description
First of all, I'm sorry if my English is hard to understand.
Currently, QWidgetTextControlPrivate::contextMenuEvent() checks its focus state and immediately returns if it is not focused.
https://github.com/qt/qtbase/blob/c4cf90b1f739c47383672de3d66b1d9d5427f5db/src/widgets/widgets/qwidgettextcontrol.cpp#L1887
As a result, if the focus policy of these widgets(QTextEdit and QPlainTextEdit) is set to Qt::NoFocus, the context menu will not be displayed.
Other widgets like QLineEdit will display a context menu like Copy/SelectAll regardless of its focus policy.
If I remove this check, it works like QLineEdit as I expected.
Is there any adverse effect when removing this check?
Attachments
Issue Links
- relates to
-
QTBUG-64053 QTextEdit as single widget will open context menu only once
- Closed