How it works...

The clicked() event of pushButtonAdd is connected to the addlist function. Similarly, the clicked() event of the pushButtonEdit, pushButtonDelete, and pushButtonDeleteAll objects are connected to the editlist, delitem, and delallitems functions, respectively. That is, on clicking any push button, the respective function is invoked. The addlist function calls the addItem function on the List Widget item to add the text entered in the Line Edit widget. The editlist function uses the currentRow method on List Widget to find out the list item to be edited.

The getText method of the QInputDialog class is invoked to prompt the user for the new text or edited text. On clicking the OK button in the dialog, the current list item will ...

Get Python GUI Programming - A Complete Reference Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.