Well, my answers:

  1. Qt Code:
    1. QList<CMerchandizeOrder*> orders=shoppingCartModel()->orders();
    To copy to clipboard, switch view to plain text mode 
    gets full ist of previous orders in model, so I can check if processed order is already in list of orders so I can then update quantity (+1) and subtotal of order (recalculate quantity*price=subtotal)
  2. query.next() is executesd excalty ONCE
  3. here is addEntry code:
    Qt Code:
    1. void CShoppingCartWidget::addEntry(structOrder& order)
    2. {
    3. // debug block
    4. qDebug() << "order.iMerchandizeID=" << order.iMerchandizeID;
    5. qDebug() << "order.iMerchandizeQuantity=" << order.iMerchandizeQuantity;
    6. qDebug() << "order.rMerchandizePrice=" << order.rMerchandizePrice;
    7. qDebug() << "order.rSubtotal=" << order.rSubtotal;
    8. qDebug() << "order.strDisplayString=" << order.strDisplayString;
    9. qDebug() << "order.strMerchandizeName=" << order.strMerchandizeName;
    10. // **** END of debug block
    11.  
    12. QList<CMerchandizeOrder*> orders=shoppingCartModel()->orders();
    13. CMerchandizeOrder* tempOrder=new CMerchandizeOrder(order);
    14. Q_CHECK_PTR(tempOrder);
    15.  
    16. /*
    17.   tempOrder.iMerchandizeID=order.iMerchandizeID;
    18.   tempOrder.iMerchandizeQuantity=order.iMerchandizeQuantity;
    19.   tempOrder.rMerchandizePrice=order.rMerchandizePrice;
    20.   tempOrder.rSubtotal=order.rSubtotal;
    21.   tempOrder.strDisplayString=order.strDisplayString;
    22.   tempOrder.strMerchandizeName=order.strMerchandizeName;
    23. */
    24.  
    25. if (!orders.contains(tempOrder))
    26. {
    27. // new merchandize
    28. shoppingCartModel()->insertRows(0, 1, QModelIndex());
    29. QModelIndex index=shoppingCartModel()->index(0, 0, QModelIndex());
    30. shoppingCartModel()->setData(index,
    31. //tempOrder.orderValues().strDisplayString,
    32. tempOrder->orderValues().strDisplayString,
    33. Qt::EditRole);
    34. }
    35. else
    36. {
    37. // merchandize exists, update quantity and subtotal
    38. }
    39. }
    To copy to clipboard, switch view to plain text mode 

So, I was working on the base of qt 4.4.0 example and there the object is created in same fashion like in my module ...