当前位置: 首页>>代码示例>>C++>>正文


C++ QContact::removeDetail方法代码示例

本文整理汇总了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);
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:35,代码来源:ut_cntpresenceinfoprovider.cpp

示例2: removeDetail

 void removeDetail( QContact& contact )
 {
     T detail = contact.detail<T>();
     contact.removeDetail( &detail );
 }
开发者ID:ionionica,项目名称:qt-mobility,代码行数:5,代码来源:tst_qcontactmanagerdetails.cpp


注:本文中的QContact::removeDetail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。