All pastes #1730477 Raw Edit

Mine

public cpp v1 · immutable
#1730477 ·published 2009-12-29 09:59 UTC
rendered paste body
bool MerchandiseCartModel::setData(const QModelIndex& index,             const QVariant& value,             int role){    if(index.isValid())    {        switch(role)        {            case Qt::DisplayRole:            {                // merchandise text, price and quantity set                return true;            }            case Qt::DecorationRole:            {                // merchandise image set                return true;            }            default:            {                // other roles handlng            }        }   // switch    }    else    {        // index not valid, returns false        return false;   // unsuccsesfull    }