Problem to combine a setInputMask and setValidator IPv4 Address into a QlineEdit
I have a QLineEdit to set my IPv4 address. In the first time, I set my QLineEdit with setInputMask to have " . . . " In the second time, I'm using a Ip Validator to check if it's a IP address
The problem is when I'm using separately, it's working but together, I can't edit my QLineEdit...
self.lineEdit_IP = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_IP.setGeometry(120,0,160,30)
self.lineEdit_IP.setStyleSheet("background-color: rgb(255, 255, 255);")
self.lineEdit_IP.setAlignment(QtCore.Qt.AlignHCenter)
self.lineEdit_IP.setInputMask("000.000.000.000")
#Set IP Validator
regexp = QtCore.QRegExp('^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){0,3}$')
validator = QtGui.QRegExpValidator(regexp)
self.lineEdit_IP.setValidator(validator)