本文整理汇总了C++中kcontacts::Addressee::emailList方法的典型用法代码示例。如果您正苦于以下问题:C++ Addressee::emailList方法的具体用法?C++ Addressee::emailList怎么用?C++ Addressee::emailList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kcontacts::Addressee
的用法示例。
在下文中一共展示了Addressee::emailList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shouldChangeEmail
void EmailEditWidgetTest::shouldChangeEmail()
{
EmailEditWidget widget;
QLineEdit *lineedit = widget.findChild<QLineEdit *>(QStringLiteral("emailedit"));
KContacts::Addressee addr;
KContacts::Email::List lst;
const QString firstEmail(QStringLiteral("[email protected]"));
lst << KContacts::Email(firstEmail);
lst << KContacts::Email(QStringLiteral("[email protected]"));
addr.setEmailList(lst);
widget.loadContact(addr);
const QString changedEmail(QStringLiteral("[email protected]"));
lineedit->setText(changedEmail);
KContacts::Addressee result;
widget.storeContact(result);
QVERIFY(!result.emailList().isEmpty());
QCOMPARE(result.emailList().first().mail(), changedEmail);
}
示例2: loadContact
void MailWidgetLister::loadContact(const KContacts::Addressee &contact)
{
KContacts::Email::List mailList = contact.emailList();
if (mailList.isEmpty()) {
setNumberOfShownWidgetsTo(1);
} else {
setNumberOfShownWidgetsTo(mailList.count());
const QList<QWidget *> widgetList = widgets();
auto wIt = widgetList.constBegin();
auto wEnd = widgetList.constEnd();
for (int i = 0; wIt != wEnd; ++wIt, ++i) {
MailWidget *w = qobject_cast<MailWidget *>(*wIt);
w->setMail(mailList.at(i));
}
}
}