I want specific words to be colored with specific colors. For example all instances of the word "one" will be colored in red, "two" in blue and the rest is plain text.
How it is done?
I want specific words to be colored with specific colors. For example all instances of the word "one" will be colored in red, "two" in blue and the rest is plain text.
How it is done?
You can do this by subclassing QSyntaxHighlighter
and defining your formatting rules. You then create an instance of your subclass and make the QTextEdit
you want to apply the formatting to its parent.
Take a look here for an example of how to do it