Python Forum
[PyQt] [Solved]Multiply a number to a DoubleSpinBox
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] [Solved]Multiply a number to a DoubleSpinBox
#8
Got it.
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()
Reply


Messages In This Thread
RE: Multiply a number to a DoubleSpinBox - by Extra - May-22-2022, 05:14 PM
RE: Multiply a number to a DoubleSpinBox - by Extra - May-22-2022, 05:52 PM
RE: Multiply a number to a DoubleSpinBox - by Extra - May-22-2022, 09:27 PM
RE: Multiply a number to a DoubleSpinBox - by Extra - May-22-2022, 09:54 PM
RE: Multiply a number to a DoubleSpinBox - by Extra - May-23-2022, 01:22 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020