foreach (Stanza st, stanzas) { InventoryItem * item = new InventoryItem(st); QString path = item->getPath(); ^^^^ crash Stanza: QList of a struct (StanzaEntry) which contains a QString and a QStringList InventoryItem::InventoryItem(const Stanza & stanza) { foreach (StanzaEntry en, stanza) { if (en.sym == "path") { I(en.vals.size() == 1); path = en.vals.at(0); continue; } .....