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

TextArea.selectionEnd sometimes returns an incorrect value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.1.0 Beta 1
    • Fix Version/s: None
    • Component/s: Quick: Controls 1
    • Labels:
      None
    • Environment:
      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

          Issue Links

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

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              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