I have a QTableView
and a QSortFilterProxyModel
which has a QStandardItemModel
as sourcemodel. I'm really desperate because I get an invalid QModelIndex
for the following code. Invalid means that column and row of the index is -1 and when I want to get an indexWidget I get null as a widget.
I really don't know actually what to expect as row and column from the QModelIndex.
QStandardItemModel* model = static_cast<QStandardItemModel*> (proxyModel.sourceModel());
QModelIndex index = model->horizontalHeaderItem (0)->index ();
I actually want to access individual widgets from the headerView.