Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cut and paste in QPlainTextEdit
erik kruyt last edited by
I have set the font of a QPlainTextEdit to Courier New:
@ QFont font = QFont("Courier New");
charFormat = new QTextCharFormat();
When I cut and paste part of a text this is going fine.
However, when I select all, cut and paste the font is not Courier New anymore.
What is the problem and how can this be solved?
[edit: Code highlighting / Vass]
goetz last edited by
You should call setFont(font) on the QPlainTextEdit.
Could you please wrap your code in two @-Tags, this makes it more readable.