
Originally Posted by
Santosh Reddy
Do you use
QTableView or a custom
QTableView, I assume it is custom class based of
QTableView. Just in case try setting the selection mode to QAbstractItemView::ExtendedSelection
You assumed wrong
i'm using a plain vanilla QTableView, and i'm really connecting to it's selection model via signals / slots.
i have tried setting the selection model to Extended already... My slot connected to the selection model (to selectionChanged) is called when i click a record... But when i hit Ctrl + A, it's not called. Also, if i select a record and then click elsewhere in the table, the record gets de-selected, but the slot never called neither.
Bump, help please? Bellow is a snippet on how i connect to the selection model... i really think there is a bug here.
Thanks,
Pierre.
connect(ui.tblVwDocumentTypes->selectionModel(), SIGNAL(selectionChanged(QItemSelection const&, QItemSelection const &)), this, SLOT(documentTypesModel_selectionChanged(QItemSelection const&, QItemSelection const&)));
To copy to clipboard, switch view to plain text mode
- ui.tblVwDocumentTypes being my table view,
- documentTypesModel_selectionChanged being my slot.
Added after 5 minutes:
Oh boy... i have cleaned the solution and re-built.... The slots get called now. i had a very similar problem a while ago after i compiled another version of Qt on another project... i believe VS2008 objects cache time-stamping has some issues, never had the problem with linux / mac.
For you all... VS2008 users: Solution -> Clean and rebuild!
Thanks anyways,
Pierre.
Bookmarks