A method to find a substring and highlight it in QTextEdit has already been proposed in stackoverflow by vicent.
This is an elegant and effective method. However as it is used:
the highlighting goes to the end of the word where the substring is detected.
I am looking for a way to define the exact number of characters. Something like this (doesn't work!):
to highlight only the substring.
Read more here: https://stackoverflow.com/questions/67928919/qtwidgets-qtextedit-textcursor-moveposition-how-to-define-the-exact-number
This content was originally published by servoz at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.