Hi to all!
In my project I have following code chunk:
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(order);
CMerchandizeOrder* tempOrder=new CMerchandizeOrder(order);
Q_CHECK_PTR(tempOrder);
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(order);
CMerchandizeOrder* tempOrder=new CMerchandizeOrder(order);
Q_CHECK_PTR(tempOrder);
To copy to clipboard, switch view to plain text mode
As you can see, tempOrder an object of CMerchandizeOrder class that is created inside this code chunk. But, when I try to see with gdb which constructor is called and I set the breakpoints in first lines of all CMerchandizeOrder constructors, the app flow never comes to either breakpoint. The result of this is that the wrong order is added into table (default values instead of gathered from constructor parameter order). What is going on?! Please help! And the debug block shows right values.
Bookmarks