Does anyone here know how can I find a QString
in the QTextEdit
and change the color of it?
Asked
Active
Viewed 999 times
0

frogatto
- 28,539
- 11
- 83
- 129

Domen Jesenovec
- 89
- 1
- 8
-
@user3528438 Nah. There is a function called `setTextColor()` that I can call. The problem is how to color just the QString i'm looking for. – Domen Jesenovec Feb 21 '16 at 19:28
1 Answers
0
You can use QTextEdit::find()
+
How to highlight a string of text within a QTextEdit
See also: QSyntaxHighlighter

Community
- 1
- 1

Vladimir Bershov
- 2,701
- 2
- 21
- 51
-
I have already done that. But I want to change the color of the text not highlight it. Thanks anyway!!! – Domen Jesenovec Feb 21 '16 at 19:26
-
@DomenJesenovec, then you need to use this answer about html formatting: [QTextEdit with different text colors (Qt / C++)](http://stackoverflow.com/a/6934270/4149835) – Vladimir Bershov Feb 21 '16 at 19:29