Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以通过覆盖 pyqt4 python 中的按键事件来禁用 qtextedit 上的字符写入?
派生QTextEdit并覆盖相应的事件处理程序方法:
QTextEdit
class MyTextEdit(QTextEdit): def keyPressEvent(self, event): event.ignore()