This is attempt 2 (still doesn't compile).

Can anyone point me in the right direction? I don't have a clue what im doing.

Qt Code:
  1. void SerialNumberProg::columnsTrial(
  2. ) {
  3.  
  4. if( ( tw = new QTableWidget( 0, 2, m_qtapp )) != NULL ) {
  5.  
  6. QAbstractItemModel *model = m_qtapp->AllocateEcoComboBox->model();
  7.  
  8. tw->setModel( model );// DOESN'T LIKE THIS LINE...
  9.  
  10. int rowcount = tw->rowCount();
  11. tw->setRowCount( rowcount + 1 );
  12.  
  13. item = new QTableWidgetItem( "id" );
  14. tw->setItem( rowcount, 0, item );
  15.  
  16. item = new QTableWidgetItem( "date" );
  17. tw->setItem( rowcount, 1, item );
  18.  
  19. m_qtapp->AllocateEcoComboBox->setView( tw );
  20. delete( tw );
  21. }
  22. }
To copy to clipboard, switch view to plain text mode