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

Can't select characters in a QLineEdit with keyboard when same shortcut exists

    XMLWordPrintable

Details

    • macOS

    Description

      If you create shortcuts assigned to Shift+Left (SelectPreviousChar) or Shift+Right (SelectNextChar), when a QLineEdit has the focus, you can't select characters in that QLineEdit with Shift+Left/Shift+Right, even though the QLineEdit in focus is supposed to have priority over the shortcuts.

       

       

      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
      {
          setCentralWidget(new QLineEdit("Try Shift+Left/Right arrow", this));
          new QShortcut(QKeySequence::MoveToPreviousChar,this);
          new QShortcut(QKeySequence::MoveToNextChar,this);
          new QShortcut(QKeySequence::SelectPreviousChar,this);
          new QShortcut(QKeySequence::SelectNextChar,this);
      }
      

       

      Reproducible with Qt 6.6 and Qt 6.8

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            divide Robin Lobel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes