QValidator

class PyQt5.QtGui.QValidator

C++ documentation