Hi,

I don't mean this to be a double post, so please forgive me if I should have added this to my last thread.

I have a model derived from QAbstractTabelModel, this is used with a QTableView. To sort the data in the table, I used the following :

Qt Code:
  1. m_pModel = new DACanTreeModel();
  2. m_proxyModel = new QSortFilterProxyModel(this);
  3. m_proxyModel->setDynamicSortFilter(true);
  4. m_proxyModel->setSourceModel(m_pModel);
  5.  
  6. list << "ECU" << "Signal" << "Signal Data" << "Real value" << "Unit" << "Count";
  7. m_pModel->setHeaders( list );
  8.  
  9. ui.canTreeView->setSortingEnabled( true );
  10. ui.canTreeView->setModel( m_proxyModel);
To copy to clipboard, switch view to plain text mode 

For some reason, data is now not being shown in the table view unless I click on the column headers and when I do, a crash occurs, is the above code wrong? If I set the views model to m_pModel, the data appears, but I cannot sort it.

Thanks,
Steve