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

Not possible to select first point in list in a text edit

    XMLWordPrintable

Details

    • All

    Description

      This issue is mostly annoying because even if you do Ctrl+A you can't delete everything in one press. But it also means that you can't change font size etc on the first point at all, making you have to add another line above first.

      I've been looking at this issue a bit in the code and it seems like the internals of QTextDocument has a special case for when the cursor position is -1: https://github.com/qt/qtbase/blob/dev/src/gui/text/qtextdocument_p.cpp#L674

      But all the way through QTextCursor there's checks and asserts to make sure pos is never -1. I assume it can happen when setBlockCharFormat is run on the first block but it should also happen for select all, select line, and in QWidgetTextControl::mouseMoveEvent when selecting above top left.

      Same bug (I assume), and repro: QDS-8192

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              cyriuz Viktor Arvidsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change