I have used Qt before. Now I needed it again for a simple application that uses Qt4 QTextEdit to display plain text.
I ran into two problems:
undo () method vanished in Qt4
Where did it go? Qt3 porting documentation to Qt4 recommends to use Qt3 compatibility libraries or port to Qt4. It does not say how to port it.
setting a single font for QTextEdit is problematic
It is very confusing that both QTextDocument and QTextEdit has font setting methods, it looks like a poor design to me. Besides, they don't work for plain text. The only thing that for me is QTextEdit is: selectAll, setCurrentFont.
The problem with this nasty approach is that the text remains selected (there is no unselect method in QTextEdit).
Another problem with this approach that is using setCurrentFont: when user deletes all text from QTextEdit the default Arial font comes back which is not particularily good for plain text display
Bookmarks