Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.3
-
None
-
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()