Hi All,
I've a plain text edit in myt dialog. i want to write "XYZ " in red color and "ABC" in black color. How can i do this? i tried to set pallet. but its not working. I've attached sample code of my apllication. please help me.
Thank you.
Hi All,
I've a plain text edit in myt dialog. i want to write "XYZ " in red color and "ABC" in black color. How can i do this? i tried to set pallet. but its not working. I've attached sample code of my apllication. please help me.
Thank you.
try this:
Qt Code:
yourTextEdit->append("<font color = red>XYZ</font>");To copy to clipboard, switch view to plain text mode
That wont work for a QPlainTextEdit. But you can set a syntaxhighlighter. See the "Syntax Highlighter Example" in the docs or direct QSyntaxHighlighter. Or you can use the the basic options of the text cursor which should be the fastest appproach. See QTextCursor and QTextCharFormat.
oh yea thats right. would work for QTextBrowser tho, and I think QTextEdit
Bookmarks