Well, the addEntry() is reached and the model works fine since test data ARE added to table widget becuase I can see them. I've put qDebug() where you asked, the values are ok and here is the method that calls addEntry. I've doublechecked this tmpOrder and data are fetched ok:
Qt Code:
  1. void COperationWIndow::chooseMerchandize()
  2. {
  3. structOrder tmpOrder; // temp order
  4. QString queryString("SELECT * from merchandize WHERE IdentificationNumber=%1 AND InUse=1;");
  5. int iMerchandizeId=m_pMerchandizeBrowser->m_iSelected+1; // calcualtes id
  6.  
  7. queryString=queryString.arg(iMerchandizeId); // adds id to query string
  8. qDebug() << "Query: " << queryString; // debug
  9. QSqlQuery query(queryString); // sets up query from query string
  10. qDebug() << query.lastError().text(); // debug
  11. if (query.isActive())
  12. {
  13. while (query.next())
  14. {
  15. tmpOrder.iMerchandizeID=query.value(0).toInt();
  16. tmpOrder.iMerchandizeQuantity=1;
  17. tmpOrder.rMerchandizePrice=(qreal)query.value(3).toDouble();
  18. tmpOrder.rSubtotal=tmpOrder.iMerchandizeQuantity*tmpOrder.rMerchandizePrice;
  19. tmpOrder.strMerchandizeName=QString(query.value(2).toString());
  20. tmpOrder.strDisplayString=QString::number(tmpOrder.iMerchandizeID)+strMerchandizeSpaceDelimiter+\
  21. QString(tmpOrder.strMerchandizeName)+strMerchandizeDelimiter+\
  22. QString::number(tmpOrder.rMerchandizePrice, 'f', iMerchandizePricePrecision)+strMerchandizeSpaceDelimiter+\
  23. QString::number(tmpOrder.iMerchandizeQuantity)+strMerchandizeSpaceDelimiter+\
  24. QString::number(tmpOrder.rSubtotal, 'f', iMerchandizePricePrecision);
  25. m_pShoppingCartWidget->addEntry(tmpOrder);
  26. } // while
  27. m_pShoppingCartWidget->resizeColumnsToContents();
  28. m_pShoppingCartWidget->resizeRowsToContents();
  29. if(m_pOrderButton->isEnabled()==false)
  30. m_pOrderButton->setEnabled(true); // enables order buttn
  31. } // if
  32. }
To copy to clipboard, switch view to plain text mode 

I've been banging my head for a whole day now.