Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112721

QLineEdit standard menu actions do not have object names

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15, 6.5
    • None
    • All

    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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            musicamante Maurizio Berti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes