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

QPlainTextEdit text cursor unable to get selected text in some circumstances

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.11, 6.4.2
    • GUI: Text handling
    • None
    • Windows

    Description

      I am noticing a strange issue with QPlainTextEdit whereby it seems, in some circumstances, I have text selected but checking the object's textCursor() lies to me by telling me I have no text selected, and if I ignore that and check the start and end position, claims they are both the same when actually they are not.

      The easiest way to demonstrate this is with this application: https://github.com/thedjnK/AuTerm

      Reproduction steps:

      1. Build and run
      2. Once opened, click the terminal tab
      3. Type "22"
      4. Select those 2 characters and right click then click the second menu option
      5. The output shows "Error code 0x0" which is wrong because the selected text is 22
      6. If you have a serial device, you can open the port, press enter to send, then select the "22" that was sent in the terminal and right click the select the second menu option, upon doing this, it magically can detect you have selected some text

      In this application, I have a custom event filter for dealing with keypresses - is this perhaps a cause for it, if something is not being updated or an event is not being triggered?

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            thedjnk Mr nK
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes