Re: Constructor call problem
I've changed the code in addEntry() to:
Code:
void CShoppingCartWidget::addEntry(structOrder& order)
{
// debug block
qDebug() << "order.iMerchandizeID=" << order.iMerchandizeID;
qDebug() << "order.iMerchandizeQuantity=" << order.iMerchandizeQuantity;
qDebug() << "order.rMerchandizePrice=" << order.rMerchandizePrice;
qDebug() << "order.rSubtotal=" << order.rSubtotal;
qDebug() << "order.strDisplayString=" << order.strDisplayString;
qDebug() << "order.strMerchandizeName=" << order.strMerchandizeName;
// **** END of debug block
QList<CMerchandizeOrder*> orders=shoppingCartModel()->orders();
//CMerchandizeOrder* tempOrder=new CMerchandizeOrder(order);
//Q_CHECK_PTR(tempOrder);
CMerchandizeOrder tempOrder(order);
/*
tempOrder.iMerchandizeID=order.iMerchandizeID;
tempOrder.iMerchandizeQuantity=order.iMerchandizeQuantity;
tempOrder.rMerchandizePrice=order.rMerchandizePrice;
tempOrder.rSubtotal=order.rSubtotal;
tempOrder.strDisplayString=order.strDisplayString;
tempOrder.strMerchandizeName=order.strMerchandizeName;
*/
if (!orders.contains(&tempOrder))
{
// new merchandize
shoppingCartModel()->setData(index,
tempOrder.orderValues().strDisplayString,
//tempOrder->orderValues().strDisplayString,
Qt::EditRole);
}
else
{
// merchandize exists, update quantity and subtotal
}
}
and I get same result. :crying:
Re: Constructor call problem
The problem has been solved, I've checked all sources related to table widget and I found some merchandize order field reset code from other developer that I did not have been aware god damn!!!! :o Stupid, stupid, stupid! Anyway, thanks all repliers for your time. But gdb still has problems with setting breakpoints in constructors ...
Re: Constructor call problem
relief for me too,,,, i was also begining to bang my head :D
i told ya,, u must be overriding somewher :p