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

QTextEdit::cursorForPosition() doesn't work with invisible blocks

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11

      Description

      When a QTextEdit has some invisible blocks, QTextEdit::cursorForPosition() sometimes returns a QTextCursor inside an invisible block (when you click in between blocks where the invisible block would be). If you get the QRectF for this cursor, it will often not be where it is supposed to since the invisible block doesn't have valid coordinates. So if you have a QTextEdit with some invisible blocks, even just clicking around, the cursor will sometimes jump to random other blocks. I created a minimal example to show this bug. The example populates a QTextEdit with 500 blocks and makes roughly half of them invisible. If you click in between two blocks (in the margin space) where an invisible block would be, the cursor will often jump/go to random places it shouldn't be. Feel free to contact me for more information.

        Attachments

        1. main.cpp
          1.0 kB
          Joshua Grauman
        2. textedit.pro
          0.1 kB
          Joshua Grauman
        For Gerrit Dashboard: QTBUG-91774
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            jgrauman Joshua Grauman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There is 1 open Gerrit change