QTextEdit Text Option use Error.
Pada_ last edited by Pada_
I modified QTextEdit to change the size, font, and color of the text.
After creating the contents, change the attributes (size, font, color) and press the return key (Ctrl + Z), the previous attributes are not maintained and the 20th color is returned to black again.
Is there a way to keep it?
newFormat.setFontWeight(isBold ? QFont::Bold : QFont::Normal);
Then, when you write the text again, the first character will return to font size and color 20. However, from the second letter, it will be displayed in the size and color set above.
How do I make changes to the first one?
What version of Qt are you using ?
On what platform ?
Pada_ last edited by
Windows 8 64Bit
Windows 10 64Bit
The platform does not seem to matter. It seems to be because there is no code that can put the old one back when you run undo.
Qt 5.4 being pretty outdated, did you check whether you still have the same behaviour with 5.12 or the current 5.13 preview ?