PDA

View Full Version : User row selection in QTableView



Banjo
16th November 2008, 21:29
Hello
I have a QTableView where the user clicks on rows to display a row of data in a DataWidgetMapper. They then edit it

My problem is that I need to distinguish between rows that are selected by the user and those that are selected programmatically. If the row is selected by the user, I need to ask for save confirmation. If the row is selected programiticaly - first row in list after a search for example, then the save confirmation is not called. At the moment I am using currentRowChanged, but that is picking up row selections by both the user and the application

Banjo
16th November 2008, 22:56
I have tried activated for user selections and that seems to be working but how do I detect row changes only made programatically

aamer4yu
17th November 2008, 04:23
( Total rows selected - no of user rows selected ) :)

by the way if u want to save changed data, u can have a look at QAbstractItemView::commitData . I dont see the need for monitoring which rows have changed programitcally and which have been changed by the user...