QTableView no selection signal
General and Desktop
6
Posts
2
Posters
1.5k
Views
1
Watching
-
I want to code a button that is disabled initially bt when someone selects a row in QTableView it is enabled, now coding it to enable is easy, but I also want it to disable automatically when there is no selection on QTableView. How can I do that?
~Thanks in advance -
Hi,
Looks like a job for QAbstractItemView::selectionChanged. Check if the selection is empty or not and enable your button based on that.
Hope it helps
-
No need for subclassing, just add a slot to whatever widget contains both your QPushButton and QTableView