Python Forum
[PyQt] [Solved]How to check if row is selected and grab Name from row
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] [Solved]How to check if row is selected and grab Name from row
#6
(Jun-07-2022, 11:46 PM)Extra Wrote: So if nothing is selected and the user presses a button, a msgBox pops up reminding the user to select a row before clicking the button.

That is possible, for example the checkout button

    def CheckoutClicked(self):
        #Print in terminal for testing:
        if self.InventoryDisplay.selectedIndexes():
            print("row selected")
            #Switch from this screen to the Checkout Popup Screen (Scene Swap):
     
            # from CheckoutPopup import Ui_CheckoutPopup
            # x = Ui_CheckoutPopup()
            # x.ConfirmClicked()
            # print("Test: " ,x.CheckoutSpinBox.value())
     
            # self.win = Ui_CheckoutPopup()
            # self.win.show()
            # #self.close()
     
            self.ex = Ui_CheckoutPopup(parent=self)
            self.ex.show()
        else:
            msgBox = QMessageBox.warning(None, "Error", 
                                         "No row is selected!\nPlease select a row", 
                                         QMessageBox.Close)
Reply


Messages In This Thread
RE: How to check if row is selected and grab Name from row - by Axel_Erfurt - Jun-08-2022, 08:31 AM

Forum Jump:

User Panel Messages

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