Home > other >  How to judge whether there is selected in the QTableView item?
How to judge whether there is selected in the QTableView item?

Time:12-20

How to judge whether there is selected in the QTableView item? Judge operation should be in what position? If used only clicked signals when click QTableView click one trigger but if you click QTableView, losing the selected item does not trigger. Functions, when with the selected item in QTableView, Enable a button if there are no selected items in a QTableView Disable problem is to judge what processing operations should be use? And how to determine whether there is selected in the QTableView project (I use currentIndex without success? Now ready to test QTableView focus event success, hope and give guidance!!!!!!

CodePudding user response:

See selectionModel () function, the object returned with it (QItemSelectionModel) the selectionChanged () signal, can deal with what you said requirements,

CodePudding user response:

OK done thank top greatly! First by QItemSelectionModel binding the selectionChanged through the slot in signal processing of QItemSelectionModel hasSelection method to judge whether to have the option of post-processing operation through currentIndex which event filtering method for the currently selected item I tested under the seemingly no binding QItemSelectionModel or tableView appeared to have no...

CodePudding user response:

Can be judged hasSelection method, but can't determine to cancel
  • Related