QVariantMap SeasideProxyModel::get(int row) const { // needed for SectionScroller. QVariantMap m; SeasidePerson *p = personByRow(row); m["sectionBucket"] = p->sectionBucket(); return m; }
QVariant SeasidePeopleModel::data(const QModelIndex& index, int role) const { SeasidePerson *aperson = personByRow(index.row()); if (!aperson) return QVariant(); switch (role) { case Qt::DisplayRole: return aperson->displayLabel(); case FirstNameRole: return aperson->firstName(); case LastNameRole: return aperson->lastName(); case SectionBucketRole: return aperson->sectionBucket(); case PersonRole: return QVariant::fromValue<SeasidePerson *>(aperson); default: return QVariant(); } }