Got it.
I'm now able to delete a selected row.
This is what I did:
I'm now able to delete a selected row.
This is what I did:
#RemoveItem Function def RemoveItemClicked(self): #Print in terminal for testing: print("The Delete Item Button was clicked") #Delete Items from the Inventory index = self.InventoryDisplay.currentIndex() NewIndex = self.InventoryDisplay.model().index(index.row(), 0) print('Index is :',NewIndex) indexID = self.InventoryDisplay.model().data(NewIndex) print(indexID) connection = sqlite3.connect("inventory.db") cursor = connection.cursor() cursor.execute("DELETE FROM items WHERE id = ?", (indexID,)) connection.commit() connection.close()