Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGraphicsTextItem: Hyphen breaks string selection (non word character)
MS_GX last edited by MS_GX
QGraphicsTextItemwith just one long string in it.
If double-click on the string I can select it. But if I have a hyphen in the string, the selection will stop at the hypen.
So for example if I have the string
ABC-DEFI can either select
DEF, but NOT the full
I think the problem is that the hypen is not a word character. Where can I change this?
Where can I change this?
In QTextEngine::atWordSeparator() by compiling Qt by yourself. So basically - nowhere except you implement your own doubleClick behavior.
MS_GX last edited by
OK, thanks for your answer. How would I read the text from the QGraphicsTextItem, crop the text and only mark the cropped text?
The text can found in QGraphicsTextItem::document()