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.
我setValidator(QIntValidator)在 PyQt 中使用过。如何重置此验证器以像以前一样接受所有输入?我想动态处理验证,这就是为什么......
setValidator(QIntValidator)
由于Qt文档:
如果v == 0,setValidator()删除当前输入验证器
v == 0
setValidator()
所以,使用setValidator(None).
setValidator(None)