一旦使用了某个验证器,如何重置 QValidator 以接受所有输入

How to reset the QValidator to accept all input once some Validator is used

我用过 PyQt 中的 setValidator(QIntValidator)。如何重置此验证器以像以前一样接受所有输入?我想动态处理验证,这就是为什么 ...

由于Qt documentation:

If v == 0, setValidator() removes the current input validator

所以,使用setValidator(None)