Fixed it ha!
Because I have a virtual column in column zero, but mapToSource returns an invalid QModelIndex for column zero (because it doesn't exist in the source) then the flags for column zero are empty -- and makes it non-selectable.
If I provide my own version of ::flags() and make it selectable the arrow keys spring into life. yay!
here is the bit of code I needed to add, I make the groupby's unselectable since they are just 'headings' not data (if that makes any sense).
Qt
::ItemFlags flags
( const QModelIndex & index
) const { if (index.internalPointer() == NULL) {
return Qt::ItemIsEnabled;
} else {
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}
}
Qt::ItemFlags flags ( const QModelIndex & index ) const {
if (index.internalPointer() == NULL) {
return Qt::ItemIsEnabled;
} else {
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks