문제

How to edit cell manually like in Excel:
Alt + Enter -> line break (true break, not simply line break symbol on the same line)
Enter -> exit from edit mode?

EDIT:
Text in one cell in view mode:
Line1
Line2

Same text in edit mode:
Line1 Line2

Besides, 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top