How to set a comboBox Text an empty string if the index is 0?
-
wrote on 22 Jul 2022, 10:35 last edited by
I want to set a comboBox text to an empty string when the comboBox index is 0. I tried the code below but it exits my application. Please any help on what am doing wrong. Thanks in advance.
Check = " " qualification = self.ui.qualification_comboBox.currentText() if self.ui.qualification_comboBox.currentIndex() == 0: self.ui.qualification_comboBox.setCurrentText(Check)
-
I want to set a comboBox text to an empty string when the comboBox index is 0. I tried the code below but it exits my application. Please any help on what am doing wrong. Thanks in advance.
Check = " " qualification = self.ui.qualification_comboBox.currentText() if self.ui.qualification_comboBox.currentIndex() == 0: self.ui.qualification_comboBox.setCurrentText(Check)
@LT-K101 said in How to set a comboBox Text an empty string if the index is 0?:
I tried the code below but it exits my application
So, did you use debugger to see what happens and to provide stack trace here, so others can check what happens?
Also the string you're setting is not empty. -
@LT-K101 said in How to set a comboBox Text an empty string if the index is 0?:
I tried the code below but it exits my application
So, did you use debugger to see what happens and to provide stack trace here, so others can check what happens?
Also the string you're setting is not empty.wrote on 22 Jul 2022, 12:49 last edited byThis post is deleted!
1/3