In this article we will see how we can get the text i.e content of current item selected in the combo box, in order to do this we will use the
Syntax : combo_box.currentText()
Argument : It takes no argument
Return : It return string
Steps for implementation –
1. Create a combo box
2. Add items to combo box
3. Create push button
4. Add action to the push button
5. Create label to show count
5. Inside the action get the content of current item selected in combo box with the help of currentText method and store it in variable
6. Show the content variable in label with the help of setText method
Below is the implementation –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.