@Axel-Spoerl
I took this method from the example of the Qt text editor, it works if any text is selected with this cursor, and continues typing with this cursor with the specified font further.
But here's the problem, if I want the behavior as in standard text editors, to first set the font modifiers and then start typing, the font in the cursor is reset to the standard one from QTextDocument.
The option to store the cursor in the heap is unlikely to work, since it is impossible to set the cursor in the QTextDocument.
At the moment, I have solved the problem using "Pending font", if the cursor does not have any text under it, I write all font changes to the QFont variable, and display font data from it on the UI, and as soon as the user enters something, I immediately apply font settings to the entered character, so far it works quite well.
But if it is possible to change the font settings for future input without workarounds, I would be glad to know.