This code iterate over the QList and call the toString() member function:
for(QList<Transaction>::ConstIterator it = m_Transactions.begin(); it != m_Transactions.end(); ++it) {
std::cout << qPrintable(it->toString()); //i used qPrintable to be able to print QString to std::cout
}
for(QList<Transaction>::ConstIterator it = m_Transactions.begin(); it != m_Transactions.end(); ++it) {
std::cout << qPrintable(it->toString()); //i used qPrintable to be able to print QString to std::cout
}
To copy to clipboard, switch view to plain text mode
LE: and about the problem if you sell many times, make sure you call sell for the same object, or you can post more code, because that append should work.
Bookmarks