本文整理汇总了C++中Contact::firstName方法的典型用法代码示例。如果您正苦于以下问题:C++ Contact::firstName方法的具体用法?C++ Contact::firstName怎么用?C++ Contact::firstName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact::firstName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: personalInfoAvailable
void JabberPersonalInfoWidget::personalInfoAvailable(Contact contact)
{
NickName->setText(contact.nickName());
FirstName->setText(contact.firstName());
LastName->setText(contact.lastName());
Sex->setCurrentIndex((int)contact.gender());
FamilyName->setText(contact.familyName());
BirthYear->setText(QString::number(contact.birthYear()));
City->setText(contact.city());
FamilyCity->setText(contact.familyCity());
}
示例2: data
QVariant ContactTableModel::data(const QModelIndex& index, int role) const {
if (!index.isValid())
return QVariant();
if (index.row() >= list.count() || index.row() < 0)
return QVariant();
if (role == Qt::DisplayRole) {
Contact *c = list.at(index.row());
if (index.column() == 0)
return c->firstName();
else if (index.column() == 1)
return c->lastName();
else if (index.column() == 2)
return c->mailAddress();
}
return QVariant();
}
示例3: filterContacts
//! [7]
void AddressBook::filterContacts()
{
QList<Contact> contacts;
if (m_filter.isEmpty()) {
// No filter has been specified, so just list all contacts
ContactListFilters filter;
contacts = m_contactService->contacts(filter);
} else {
// Use the entered filter string as search value
ContactSearchFilters filter;
filter.setSearchValue(m_filter);
contacts = m_contactService->searchContacts(filter);
}
// Clear the old contact information from the model
m_model->clear();
// Iterate over the list of contact IDs
foreach (const Contact &idContact, contacts) {
// Fetch the complete details for this contact ID
const Contact contact = m_contactService->contactDetails(idContact.id());
// Copy the data into a model entry
QVariantMap entry;
entry["contactId"] = contact.id();
entry["firstName"] = contact.firstName();
entry["lastName"] = contact.lastName();
const QList<ContactAttribute> emails = contact.emails();
if (!emails.isEmpty())
entry["email"] = emails.first().value();
// Add the entry to the model
m_model->insert(entry);
}
}