I'm developing a Qt application and I'm trying to implement this feature where if you type a word all it's occurences in a QLabel get highlighted. I'm not sure how to do it. Is there a way for iterate through text in QLabel and change the background colour of certain word?
It can be done using in QTextEdit by using QTextEdit::ExtraSelection
. But QLabel doesn't have this method.
So for example if the searched word is "sed" I want to get something like this in my QLabel: