本文整理汇总了C++中QContact::removeDetail方法的典型用法代码示例。如果您正苦于以下问题:C++ QContact::removeDetail方法的具体用法?C++ QContact::removeDetail怎么用?C++ QContact::removeDetail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QContact
的用法示例。
在下文中一共展示了QContact::removeDetail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testHandlePresenceUpdate
void TestCntPresenceInfoProvider::testHandlePresenceUpdate()
{
QSignalSpy spy(mCntPresenceInfoProvider, SIGNAL(infoFieldReady(CntInfoProvider*, int, ContactInfoField, const QString&)));
PrcPresenceWriter *writer = PrcPresenceWriter::createWriter();
PrcPresenceReader *reader = PrcPresenceReader::createReader();
PrcPresenceBuddyInfoQt *dummyBuddy = PrcPresenceBuddyInfoQt::createInstance();
dummyBuddy->setIdentity("sip:[email protected]");
dummyBuddy->setAvailability(PrcPresenceBuddyInfoQt::PrcAvailable, "meh");
writer->writePresence(*dummyBuddy);
mCntPresenceInfoProvider->handlePresenceUpdate(true, dummyBuddy);
QCOMPARE(spy.count(), 0);
mCntPresenceInfoProvider->handlePresenceUpdate(false, dummyBuddy);
QCOMPARE(spy.count(), 0);
mCntPresenceInfoProvider->handlePresenceUpdate(true, NULL);
QCOMPARE(spy.count(), 0);
PrcPresenceBuddyInfoQt *buddy = reader->presenceInfo("sip:[email protected]");
buddy->setAvailability(PrcPresenceBuddyInfoQt::PrcNotAvailable, "meh");
writer->writePresence(*buddy);
QTest::qWait(5000);
QCOMPARE(spy.count(), 1);
QContactManager manager("symbian");
QContact c = manager.contact(mCntPresenceInfoProvider->mBuddyMap.value("sip:[email protected]"));
QList<QContactOnlineAccount> accounts = c.details<QContactOnlineAccount>();
foreach (QContactOnlineAccount account, accounts)
{
c.removeDetail(&account);
}
示例2: removeDetail
void removeDetail( QContact& contact )
{
T detail = contact.detail<T>();
contact.removeDetail( &detail );
}