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

Inconsistency between TextInput and TextEdit cursor positioning when doing empty selection

    XMLWordPrintable

Details

    Description

      When calling select(0, 0) in TextInput, it does not alter the cursor position. If you do the same with TextEdit it sets the cursor to position 0. This is a minor issue, but I would expect consistent behavior between these components unless otherwise documented.

      My recommendation would be not to move the cursor since I believe there's no other way to clear a selection programmatically, and not repositioning the cursor in this case prevents slightly annoying UI behavior in such case, especially when some kind of a "ensureCursorVisible" functionality is used for keeping the cursor visible.

      When doing actual selection (e.g. select(10, 11)) both editors move the cursor to the end of selection.

      Here's the outcome of the test snippet I attach to this report:
      TEXTINPUT CASE 1:
      TextInput initial cursor position:20
      TextInput cursor position after selection:11
      TEXTINPUT CASE 2:
      TextInput initial cursor position:20
      TextInput cursor position after empty selection:20
      TEXTEDIT CASE 1:
      TextEdit initial cursor position:20
      TextEdit cursor position after selection:11
      TEXTEDIT CASE 2:
      TextEdit initial cursor position:20
      TextEdit cursor position after empty selection:0

      Attachments

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

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            tanelih Taneli Haverinen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes