bool StoreSection::deserialize(){ //--------------- //To deserialize int, QString, float, bool, long, QDateTime //just call getSerialProperty (returns a QVariant) //--------------- m_title = getSerialProperty("title").toString(); //------------------- //To deserialize QHash, QList, QVector: // a) Obtain child count // b) Instantiate each child // c) Deserialize each child // d) add to QHash, QList or QVector //------------------- m_books.clear(); int index, total; //step (a) total = getSerialObjectCount("books"); //getSerialObjectCount return number of items inside "books" (xml tag) for (index = 0; index < total; index++ ) { //step (b) Book *book = new Book(this); //step (c) getSerialObject("books", book, index); if (book == 0) { book->deleteLater(); return false; } //step (d) m_books.insert(book->getTitle(), book); } //--------------- //Always return a boolean //beacause you may want to include this object in another inner serialization //--------------- return true; }