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

TextArea.selectionEnd sometimes returns an incorrect value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.1.0 Beta 1
    • Quick: Controls 1
    • None
    • Qt MinGW 32-bit
      Windows 7 64-bit

    Description

      Steps to reproduce:
      1. Run qtquickcontrols/examples/quick/controls/text (one of your examples);
      2. Click a word in the paragraph starting with "If you are viewing this document" three times to select the whole paragraph.

      Expected results:
      Nothing happens.

      Actual results:
      The font of the selected paragraph becomes as large (16) as the font of the following heading of "Font and Paragraph Styles".

      Note:
      If the binding at the bottom of main.qml:

      selectionEnd: textArea.selectionEnd

      is changed to:

      selectionEnd: textArea.selectionEnd > 0 ? textArea.selectionEnd – 1 : 0

      the issue seems to be fixed, that is, it cannot be reproduced any more but it's not clear if this workaround would not cause other problems.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ddobrev Dimitar Dobrev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes