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

QTextCursor does not consider smart quotes and em dashes as word boundaries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.3
    • GUI: Text handling
    • None
    • All
    • All

    Description

      QTextCursor does not consider smart quotes and em/en dashes as word boundaries. It does however consider plain quotes and hyphens as word boundaries. This behavior is inconsistent. Easily demonstrated by entering for example “Images” in a Qt text edit control and double clicking on the word, you will see the smart quotes at the end are also selected.

       

      Here is a trivial 5-line PyQt6 script to reproduce, run it and double click on the various words to see the inconsistent behavior:

       

      from PyQt6.QtWidgets import QPlainTextEdit, QApplication
      app = QApplication([])
      q = QPlainTextEdit()
      q.setPlainText('“Images” "Images"\none—two one-two')
      q.show()
      app.exec()

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            kovidgoyal Kovid Goyal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes