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

DeleteStartOfWord with a selection in QLineEdit has unexpected behavior

    XMLWordPrintable

Details

    • All
    • 1d953b2fb (dev), 1df12820f (6.7), 01546825a (6.6), 029a4c3ec (tqtc/lts-6.5)

    Description

      When executing QKeySequence::DeleteStartOfWord (Ctrl + Backspace) in a QLineEdit with text selected has unexpected behavior when compared to other inputs such as a QTextEdit (or browsers).

      The following table shows the different behavior when pressing Ctrl + Backspace. ^ shows the selection and | shows the cursor position.

      Input QLineEdit QTextEdit (and browsers)
      Some Text|
      
      Some |
      
      Some |
      Some Text|
      ^^^^^^^^^
      
      |Text
      
      |(empty)
      Some Text|
           ^^^^
      
      Some |Text
      
      Some |
      Some Text|
          ^^^^^
      
      |(empty)
      
      Some|
      Some Text|
         ^^^^^^
      
      |(empty)
      
      Som|
      Some|
      ^^^^
      
      |Some
      
      |(empty)

      In a screen recording (top is QTextEdit, bottom is QLineEdit).

      I'm happy to contribute a fix for this issue.

      Attachments

        For Gerrit Dashboard: QTBUG-120006
        # Subject Branch Project Status CR V

        Activity

          People

            nerixyz Tom Fors
            nerixyz Tom Fors
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes