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

QtextEdit: Cannot select words using mouse till the the beginning of a line (when it's just one character)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.0 Alpha
    • None
    • Linux/X11

    Description

      It's a bug found on kde, but it's a QTextEdit bug:

      "

      SUMMARY
      Double-click&drag selection does not let you select the first word in line.

      STEPS TO REPRODUCE
      1. Double click on a word in KTextEdit to start selection of several whole words.
      2. Keep holding the left mouse button and move the pointer to the left of text edit.

      OBSERVED RESULT
      In the line "A set of blank cards is shown. Each card has a picture on the other side, ", the first word "A" is never selected.

      EXPECTED RESULT
      Every word till the beginning of the line should be selected."

       

      I attached a test case.

      And I created a patch for it (but not sure if it's correct).

       

      When we have just one characters as "a set dd" when we try to call:

      if (!curs.movePosition(QTextCursor::StartOfWord)) it will return false, as

      we are not in a word. it will return so it will not select this character.

       

      We will same problem when we select have an unique character at the end of line.

      But my patch will not fix it.

       

      (test with: "a foo bla e" and double click on "bla" and try to select last character "e")

       

      Regards

       

       

      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
            montel Montel Laurent
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes