What is the most efficient way to reset the color of all the text in a QTextEdit? SetTextColor only sets the color of the current format and does not change existing text. Thanks for any help.
What is the most efficient way to reset the color of all the text in a QTextEdit? SetTextColor only sets the color of the current format and does not change existing text. Thanks for any help.
Hey,
stylesheets would solve your problem. Create a Stylesheet and set it to your QTextEdit.
Stelios: What the hell are you laughing at?
Astinos: Well, you had to say it!
Stelios: What?
Astinos: "Fight in the shade"!
-------------------------------------------
If my answer has helped you, i would appreciate it if you use the thanks button.
If you don't have any other format in the text: save the text to a QString, clear the edit and set the text with the new color. Otherwise I guess you have to loop through your text formats.
Thanks. I've tried setting the StyleSheet, but it is overridden by the text formats. Saving and clearing works fine; the only other format was a base font.
Bookmarks