How to edit cell manually like in Excel:
Alt + Enter -> line break (true break, not simply line break symbol on 开发者_StackOverflow社区the same line) Enter -> exit from edit mode?EDIT:
Text in one cell in view mode: Line1 Line2Same text in edit mode:
Line1 Line2Besides, I cannot write newline in cell, I can insert it only by copying.
A easy solution is to subclass QTableWidget and reimplement the keyPressEvent function.
You just need to change the behaviour in the cases you want and call the parent in the ones you don't want to handle.
Have a look at keyPressEvent(QKeyEvent *) method documentation in QWidget doc.
精彩评论