Jun-07-2022, 11:46 PM
(Jun-07-2022, 07:53 AM)Axel_Erfurt Wrote: If you want to select a whole row, use SelectionBehavior
self.InventoryDisplay = QTableView() self.InventoryDisplay.setSelectionBehavior(1)0 Selecting single items.
1 Selecting only rows.
2 Selecting only columns.
Thanks for this. It's helpful and very useful in my program, but I'm looking to have the program make sure a row is currently selected before a popup window opens.
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.
Once the user clicks on a row (the row is currently highlighted) then a different popup window opens.
This is to prevent a crash when the program first opens. Because nothing is selected, If the user hits the checkout button the program will crash because no item is currently selected.
So I need to either check to make sure a row is selected or when the program first opens the first row is selected by default.
Any suggestions on how to do that?
Thanks.