simplest way to highlight some part of text in QTextEdit
Solved
Qt for Python
-
Hello, sorry if this question answered before (or there is some example of it)
I want to show some text in QTextEdit and I want to highlight some word in it
for example I have this very simple function to show text in QtextEditdef show_text(self, str): self.ui.textEdit.setText(str)
For example I want when str is
<nm> is 0x23 and #str is hi
(its just a example and dont have any meaning) only<nm>
and#str
Highlight to other color
I Know I can useQSyntaxHighlighter
but sadly I cant find any good example of it -
Hi,
The example from the documentation is pretty complete. Do you have more specific questions about it ?
-
I haven't found it already translated but it's not the most complicated C++ code. The translation to Python is pretty straightforward.