Few Strings in QTextEdit in Bold avoiding HTML ?
-
Hello,
is that possible that I make some String within my QTextEdit bold or colored, without HTML?
For an example I have:bq. 5246 : 76 08 58 31 44 48 : 21(32) 53(21) 30(21) 13(20) 27(14) 40(14) 19(11) 25(11) 20(94) 28(94) 31(94) 05(09)
2201 : 04 99 21 29 36 43 : 21(74) 53(22) 30(22) 13(21) 27(53) 40(53) 19(12) 25(12) 20(11) 28(11) 05(94) 14(94)
5348 : 25 26 30 67 39 46 : 53(23) 30(23) 13(22) 27(16) 40(16) 19(13) 25(13) 20(12) 28(12) 05(11) 14(11) 38(11)
6249 : 08 09 11 19 31 48 : 53(24) 13(23) 27(58) 40(58) 19(14) 20(13) 28(13) 05(12) 14(12) 38(12) 06(11) 22(11)
8250 : 05 13 24 28 38 01 : 53(25) 13(24) 27(99) 40(99) 20(14) 28(14) 05(13) 14(13) 38(13) 06(12) 22(12) 41(12)For instance I would like to make all number 27 bold and e.g. 20 in red?
I append each Line in my QTextEdit via:
@ui->textEdit->append( cur_line );@How can I make this easily? Thanks in advance.
Sincerly Huck
-
Hi,
You might be interested by "QSyntaxHighlighter":http://qt-project.org/doc/qt-5/qsyntaxhighlighter.html
Hope it helps
-
Yes thank you.
Despite my initial exclusion, I think insertHTML might be the easiest way for me :)
Now, I highlighted the text via
@ui->textEdit->insertHtml( cur_line );@ -
Sometime, the simple solution is the best :)