- Joined
- Jun 30, 2021
- Messages
- 6
- Reaction score
- 0
I tried to validate the QLineedit not to be empty without success.
I did
it is working.
But
all works fine but the pushbutton is always enabled even the self.lineEdit_2 is empty. I request your help. (I am a self-learner and could not find solution in the web.
I did
Code:
validator = QRegExpValidator(QRegExp(r'[0-9]+'))
self.lineEdit_2.setValidator(validator)
But
Code:
def temp_var(self, text):
cur_txt = text
if cur_txt == 'Cheque' or cur_txt == 'Wire Transfer' or self.lineEdit_2.text() == "":
self.groupBox_3.show()
self.pushButton_7.hide()
self.pushButton_7.setEnabled(False)
else:
self.groupBox_3.hide()
self.pushButton_7.show()
self.pushButton_7.setEnabled(True)
all works fine but the pushbutton is always enabled even the self.lineEdit_2 is empty. I request your help. (I am a self-learner and could not find solution in the web.