Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15, 6.5
-
None
-
-
77c6b0c66 (dev), c08aed6d4 (6.7), 1f4d9d547 (tqtc/lts-6.5)
Description
Unlike the menu created for QTextEdit and QPlainTextEdit, the createStandardContextMenu() function of QLineEdit does not create object names for its actions.
While this may seem trivial, it is actually useful when trying to insert actions that should be contextually next to existing ones, for example right after clipboard actions, but before the "Select all" one.
A developer might also want to change the order of the existing actions, or change their icons.
There are some possible options, but none of them is reliable nor consistent:
- we can only assume those position based on the standard menu actions and the read only property;
- a QKeySequence match on the action text might not work if the application/OS does not show them;
- a QIcon.name() match won't work if the icon is not found or the QIconEngine doesn't support the function;
- create a completely custom menu that should possibly consider localization;
My proposal is to set object names like it's done with the QWidgetTextControl standard menu, with common names like edit-undo, edit-redo, select-all, etc.
Attachments
For Gerrit Dashboard: QTBUG-112721 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
559455,2 | QLineEdit: set object names for actions | dev | qt/qtbase | Status: MERGED | +2 | 0 |
559781,2 | QLineEdit: set object names for actions | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
559815,2 | QLineEdit: set object names for actions | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |