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


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

本文整理汇总了C++中QOrganizerItem::removeDetail方法的典型用法代码示例。如果您正苦于以下问题:C++ QOrganizerItem::removeDetail方法的具体用法?C++ QOrganizerItem::removeDetail怎么用?C++ QOrganizerItem::removeDetail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QOrganizerItem的用法示例。


在下文中一共展示了QOrganizerItem::removeDetail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: guid

void tst_QOrganizerItemDetails::guid()
{
    QOrganizerItem oi;
    QOrganizerItemGuid g1, g2;

    // test property set
    g1.setGuid("1234");
    QCOMPARE(g1.guid(), QString("1234"));
    QCOMPARE(g1.value(QOrganizerItemGuid::FieldGuid).toString(), QString("1234"));

    // test property add
    QVERIFY(oi.saveDetail(&g1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).count(), 1);
    QCOMPARE(QOrganizerItemGuid(oi.details(QOrganizerItemDetail::TypeGuid).value(0)).guid(), g1.guid());

    // test property update
    g1.setValue(101,"label1");
    g1.setGuid("12345");
    QVERIFY(oi.saveDetail(&g1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).value(0).value(101).toString(), QString("label1"));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).value(0).value(QOrganizerItemGuid::FieldGuid).toString(), QString("12345"));

    // test property remove
    QVERIFY(oi.removeDetail(&g1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).count(), 0);
    QVERIFY(oi.saveDetail(&g2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).count(), 1);
    QVERIFY(oi.removeDetail(&g2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).count(), 0);
    QVERIFY(oi.removeDetail(&g2) == false);
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeGuid).count(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:32,代码来源:tst_qorganizeritemdetails.cpp

示例2: tag

void tst_QOrganizerItemDetails::tag()
{
    QOrganizerItem oi;
    QOrganizerItemTag t1, t2;

    // test property set
    t1.setTag("red");
    QCOMPARE(t1.tag(), QString("red"));
    QCOMPARE(t1.value(QOrganizerItemTag::FieldTag).toString(), QString("red"));

    // test property add
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).count(), 1);
    QCOMPARE(QOrganizerItemTag(oi.details(QOrganizerItemDetail::TypeTag).value(0)).tag(), t1.tag());
    QVERIFY(oi.saveDetail(&t2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).count(), 2);

    // test property update
    t1.setValue(101,"label1");
    t1.setTag("green");
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).value(0).value(101).toString(), QString("label1"));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).value(0).value(QOrganizerItemTag::FieldTag).toString(), QString("green"));

    // test property remove
    QVERIFY(oi.removeDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).count(), 1);
    QVERIFY(oi.removeDetail(&t2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).count(), 0);
    QVERIFY(oi.removeDetail(&t2) == false);
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTag).count(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:32,代码来源:tst_qorganizeritemdetails.cpp

示例3: attendee

void tst_QOrganizerItemDetails::attendee()
{
    QOrganizerEventAttendee a;
    QOrganizerItem oi;

    QVERIFY(a.isEmpty());
    QVERIFY(a.name().isEmpty());
    QVERIFY(a.emailAddress().isEmpty());
    QVERIFY(a.attendeeId().isEmpty());
    QVERIFY(a.participationRole() == 0);
    QVERIFY(a.participationStatus() == 0);

    a.setAttendeeId("123456");
    QVERIFY(a.attendeeId() == QString("123456"));
    a.setEmailAddress("[email protected]");
    QVERIFY(a.emailAddress() == QString("[email protected]"));
    a.setName("people");
    QVERIFY(a.name() == QString("people"));
    a.setParticipationRole(QOrganizerEventAttendee::RoleRequiredParticipant);
    QVERIFY(a.participationRole() == QOrganizerEventAttendee::RoleRequiredParticipant);
    a.setParticipationStatus(QOrganizerEventAttendee::StatusAccepted);
    QVERIFY(a.participationStatus() == QOrganizerEventAttendee::StatusAccepted);
    // add
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 0);
    QVERIFY(oi.saveDetail(&a));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEventAttendee) == a);
    // update
    a.setAttendeeId("54321");
    a.setName("newpeople");
    a.setEmailAddress("[email protected]");
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEventAttendee) != a);
    QVERIFY(oi.saveDetail(&a));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEventAttendee) == a);

    // add one more attendee
    QOrganizerEventAttendee a1;
    a1.setAttendeeId("777777");
    a1.setName("people1");
    a1.setEmailAddress("[email protected]");
    QVERIFY(oi.saveDetail(&a1));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 2);

    // remove
    QVERIFY(oi.removeDetail(&a));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 1);
    QVERIFY(oi.removeDetail(&a1));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEventAttendee).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:50,代码来源:tst_qorganizeritemdetails.cpp

示例4: displayLabel

void tst_QOrganizerItemDetails::displayLabel()
{
    QOrganizerItemDisplayLabel d1;
    QOrganizerItem oi;

    QVERIFY(d1.label().isEmpty());
    QVERIFY(d1.value(QOrganizerItemDisplayLabel::FieldLabel).isNull());
    d1.setValue(QOrganizerItemDisplayLabel::FieldLabel, "Test");
    QVERIFY(d1.value(QOrganizerItemDisplayLabel::FieldLabel) == QString("Test"));
    QVERIFY(d1.label() == QString("Test"));

    QOrganizerItemDisplayLabel d2;
    d2.setValue(QOrganizerItemDisplayLabel::FieldLabel, "Test 2");

    // test property add - should update.
    QVERIFY(oi.saveDetail(&d2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDisplayLabel).count(), 1);
    QVERIFY(oi.saveDetail(&d1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDisplayLabel).count(), 1);

    // test property update - should update
    d1.setLabel("Test 3");
    QVERIFY(oi.saveDetail(&d1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDisplayLabel).count(), 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeDisplayLabel).value(QOrganizerItemDisplayLabel::FieldLabel) == QString("Test 3"));

    // test property remove
    QVERIFY(oi.removeDetail(&d1)); // can remove display label.  it's unique but not required.
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDisplayLabel).count(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:30,代码来源:tst_qorganizeritemdetails.cpp

示例5: description

void tst_QOrganizerItemDetails::description()
{
    QOrganizerItemDescription d1;
    QOrganizerItem oi;
    QVERIFY(d1.description().isEmpty());
    QVERIFY(d1.value(QOrganizerItemDescription::FieldDescription).isNull());
    d1.setValue(QOrganizerItemDescription::FieldDescription, "Test");
    QVERIFY(d1.value(QOrganizerItemDescription::FieldDescription) == QString("Test"));
    QVERIFY(d1.description() == QString("Test"));

    QOrganizerItemDescription d2;
    d2.setValue(QOrganizerItemDescription::FieldDescription, "Test 2");

    // test property add -- description is unique.
    QVERIFY(oi.saveDetail(&d2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDescription).count(), 1); // count should be 1
    QVERIFY(oi.saveDetail(&d1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDescription).count(), 1); // count should be 1

    // test property update
    d1.setDescription("Test 3");
    QVERIFY(oi.saveDetail(&d1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDescription).count(), 1); // count should be 1
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeDescription).value(QOrganizerItemDescription::FieldDescription) == QString("Test 3"));

    // test property remove
    QVERIFY(oi.removeDetail(&d1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeDescription).count(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:29,代码来源:tst_qorganizeritemdetails.cpp

示例6: location

void tst_QOrganizerItemDetails::location()
{
    QOrganizerItemLocation l1;
    QOrganizerItem oi;

    QVERIFY(l1.isEmpty());
    l1.setLatitude(0.12345);
    QVERIFY(!l1.isEmpty());
    QVERIFY(l1.latitude() == 0.12345);
    l1.setValue(QOrganizerItemLocation::FieldLongitude, 0.54321);
    QVERIFY(l1.longitude() == 0.54321);
    l1.setLabel("test");
    QVERIFY(l1.label() == QString("test"));

    QVERIFY(oi.details<QOrganizerItemLocation>().size() == 0);
    QVERIFY(oi.saveDetail(&l1));
    QVERIFY(oi.details<QOrganizerItemLocation>().size() == 1);
    QVERIFY(oi.detail<QOrganizerItemLocation>() == l1);

    l1.setLabel("test 2");
    QVERIFY(oi.detail<QOrganizerItemLocation>() != l1);
    QVERIFY(oi.saveDetail(&l1)); // update.
    QVERIFY(oi.details<QOrganizerItemLocation>().size() == 1); // should update, not add another.
    QVERIFY(oi.detail<QOrganizerItemLocation>() == l1);

    oi.removeDetail(&l1);
    QVERIFY(oi.details<QOrganizerItemLocation>().size() == 0);
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:28,代码来源:tst_qorganizeritemdetails.cpp

示例7: type

void tst_QOrganizerItemDetails::type()
{
    QOrganizerItem oi;
    QOrganizerItemType t1, t2;

    QOrganizerEvent e;
    QOrganizerNote n;
    QOrganizerTodo t;
    QOrganizerJournal j;
    QOrganizerEventOccurrence eo;
    QOrganizerTodoOccurrence to;
    QVERIFY(e.type() == QOrganizerItemType::TypeEvent);
    QVERIFY(n.type() == QOrganizerItemType::TypeNote);
    QVERIFY(t.type() == QOrganizerItemType::TypeTodo);
    QVERIFY(j.type() == QOrganizerItemType::TypeJournal);
    QVERIFY(eo.type() == QOrganizerItemType::TypeEventOccurrence);
    QVERIFY(to.type() == QOrganizerItemType::TypeTodoOccurrence);

    // test property set
    t1.setType(QOrganizerItemType::TypeEvent);
    QCOMPARE(t1.type(), QOrganizerItemType::TypeEvent);
    QCOMPARE(static_cast<QOrganizerItemType::ItemType>(t1.value(QOrganizerItemType::FieldType).toInt()), QOrganizerItemType::TypeEvent);

    // test property add
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeItemType).count(), 1);
    QCOMPARE(QOrganizerItemType(oi.details(QOrganizerItemDetail::TypeItemType).value(0)).type(), t1.type());

    // test property update
    t1.setType(QOrganizerItemType::TypeTodo);
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(static_cast<QOrganizerItemType::ItemType>(oi.details(QOrganizerItemDetail::TypeItemType).value(0).value(QOrganizerItemType::FieldType).toInt()), QOrganizerItemType::TypeTodo);

    // test property remove
    QVERIFY(!oi.removeDetail(&t1)); // cannot remove type
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeItemType).count(), 1);
    t2.setType(QOrganizerItemType::TypeNote);
    QVERIFY(oi.saveDetail(&t2)); // overwrites t1
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeItemType).count(), 1);
    QVERIFY(!oi.removeDetail(&t2)); // cannot remove type - "succeeds" but count remains unchanged
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeItemType).count(), 1);
    QVERIFY(!oi.removeDetail(&t2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeItemType).count(), 1);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:44,代码来源:tst_qorganizeritemdetails.cpp

示例8: audibleReminder

void tst_QOrganizerItemDetails::audibleReminder()
{
    QOrganizerItemAudibleReminder r;
    QOrganizerItem oi;

    QVERIFY(r.isEmpty());
    QVERIFY(r.reminderType() == QOrganizerItemReminder::AudibleReminder);

    QVERIFY(r.secondsBeforeStart() == 0);
    QVERIFY(r.repetitionCount() == 0);
    QVERIFY(r.repetitionDelay() == 0);

    r.setSecondsBeforeStart(45);
    QVERIFY(!r.isEmpty());
    r.removeValue(QOrganizerItemReminder::FieldSecondsBeforeStart);
    QVERIFY(r.isEmpty());

    QOrganizerItemReminder baseR;
    baseR = r;
    QVERIFY(baseR.isEmpty());
    baseR.setSecondsBeforeStart(50);
    QVERIFY(baseR.secondsBeforeStart() == 50);
    QVERIFY(r.secondsBeforeStart() == 0);
    QVERIFY(!baseR.isEmpty());
    QVERIFY(r.isEmpty());

    r.setRepetition(3, 100);
    QVERIFY(r.repetitionCount() == 3);
    QVERIFY(r.repetitionDelay() == 100);
    QVERIFY(!r.isEmpty());

    r.setSecondsBeforeStart(30); // reminder, 30 seconds before the item is due to start.
    QVERIFY(r.secondsBeforeStart() == 30);

    // add
    QVERIFY(oi.details(QOrganizerItemDetail::TypeAudibleReminder).size() == 0);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeAudibleReminder).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeAudibleReminder) == r);

    // update
    r.setSecondsBeforeStart(300);
    r.setDataUrl(QUrl("http://www.test.com"));
    QVERIFY(r.dataUrl() == QUrl("http://www.test.com"));
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeAudibleReminder) != r);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeAudibleReminder).size() == 1); // should update, not add another
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeAudibleReminder) == r);

    // remove
    QVERIFY(oi.removeDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeAudibleReminder).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:53,代码来源:tst_qorganizeritemdetails.cpp

示例9: timestamp

void tst_QOrganizerItemDetails::timestamp()
{
    QOrganizerItem oi;
    QOrganizerItemTimestamp t1, t2;
    QDateTime modified = QDateTime::currentDateTime();
    QDateTime created = modified.addSecs(-43);

    // test property set
    t1.setCreated(created);
    QCOMPARE(t1.created(), created);
    QCOMPARE(t1.value(QOrganizerItemTimestamp::FieldCreated).toDateTime(), created);

    // test property add
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).count(), 1);
    QCOMPARE(QOrganizerItemTimestamp(oi.details(QOrganizerItemDetail::TypeTimestamp).value(0)).created(), t1.created());

    // test property update
    t1.setValue(101,"label1");
    t1.setLastModified(modified);
    QVERIFY(oi.saveDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).value(0).value(101).toString(), QString("label1"));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).value(0).value(QOrganizerItemTimestamp::FieldCreated).toDateTime(), created);
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).value(0).value(QOrganizerItemTimestamp::FieldLastModified).toDateTime(), modified);

    // test property remove
    QVERIFY(oi.removeDetail(&t1));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).count(), 0);
    t2.setCreated(created.addSecs(15));
    QVERIFY(oi.saveDetail(&t2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).count(), 1);
    QVERIFY(oi.removeDetail(&t2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).count(), 0);
    QVERIFY(oi.removeDetail(&t2) == false);
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeTimestamp).count(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:36,代码来源:tst_qorganizeritemdetails.cpp

示例10: emailReminder

void tst_QOrganizerItemDetails::emailReminder()
{
    QOrganizerItemEmailReminder r;
    QOrganizerItem oi;

    QVERIFY(r.isEmpty());
    QVERIFY(r.reminderType() == QOrganizerItemReminder::EmailReminder);

    QVERIFY(r.secondsBeforeStart() == 0);
    QVERIFY(r.repetitionCount() == 0);
    QVERIFY(r.repetitionDelay() == 0);

    r.setRepetition(3, 100);
    QVERIFY(r.repetitionCount() == 3);
    QVERIFY(r.repetitionDelay() == 100);
    QVERIFY(!r.isEmpty());

    r.setSecondsBeforeStart(30); // reminder, 30 seconds before the item is due to start.
    QVERIFY(r.secondsBeforeStart() == 30);

    // add
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEmailReminder).size() == 0);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEmailReminder).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEmailReminder) == r);

    // update
    r.setSecondsBeforeStart(300);
    r.setContents("subject", "body", QVariantList());
    r.setRecipients(QStringList() << "recipient" << "other recipient");
    QVERIFY(r.subject() == QString("subject"));
    QVERIFY(r.body() == QString("body"));
    QVERIFY(r.attachments() == QVariantList());
    QVERIFY(r.recipients() == (QStringList() << "recipient" << "other recipient"));
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEmailReminder) != r);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEmailReminder).size() == 1); // should update, not add another
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeEmailReminder) == r);

    // remove
    QVERIFY(oi.removeDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeEmailReminder).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:43,代码来源:tst_qorganizeritemdetails.cpp

示例11: reminder

void tst_QOrganizerItemDetails::reminder()
{
    QOrganizerItemReminder r;
    QOrganizerItem oi;

    QVERIFY(r.isEmpty());
    QVERIFY(r.reminderType() == QOrganizerItemReminder::NoReminder);

    QVERIFY(r.secondsBeforeStart() == 0);
    QVERIFY(r.repetitionCount() == 0);
    QVERIFY(r.repetitionDelay() == 0);

    r.setSecondsBeforeStart(45);
    QVERIFY(!r.isEmpty());
    r.removeValue(QOrganizerItemReminder::FieldSecondsBeforeStart);
    QVERIFY(r.isEmpty());

    r.setRepetition(3, 100);
    QVERIFY(r.repetitionCount() == 3);
    QVERIFY(r.repetitionDelay() == 100);
    QVERIFY(!r.isEmpty());

    r.setSecondsBeforeStart(30); // reminder, 30 seconds before the item is due to start.
    QVERIFY(r.secondsBeforeStart() == 30);

    // add
    QVERIFY(oi.details(QOrganizerItemDetail::TypeReminder).size() == 0);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeReminder).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeReminder) == r);

    // update
    r.setSecondsBeforeStart(300);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeReminder) != r);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeReminder).size() == 1); // should update, not add another
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeReminder) == r);

    // remove
    QVERIFY(oi.removeDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeReminder).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:42,代码来源:tst_qorganizeritemdetails.cpp

示例12: visualReminder

void tst_QOrganizerItemDetails::visualReminder()
{
    QOrganizerItemVisualReminder r;
    QOrganizerItem oi;

    QVERIFY(r.isEmpty());
    QVERIFY(r.reminderType() == QOrganizerItemReminder::VisualReminder);

    QVERIFY(r.secondsBeforeStart() == 0);
    QVERIFY(r.repetitionCount() == 0);
    QVERIFY(r.repetitionDelay() == 0);

    r.setRepetition(3, 100);
    QVERIFY(r.repetitionCount() == 3);
    QVERIFY(r.repetitionDelay() == 100);
    QVERIFY(!r.isEmpty());

    r.setSecondsBeforeStart(30); // reminder, 30 seconds before the item is due to start.
    QVERIFY(r.secondsBeforeStart() == 30);

    // add
    QVERIFY(oi.details(QOrganizerItemDetail::TypeVisualReminder).size() == 0);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeVisualReminder).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeVisualReminder) == r);

    // update
    r.setSecondsBeforeStart(300);
    r.setMessage("test");
    r.setDataUrl(QUrl("http://www.test.com"));
    QVERIFY(r.message() == QString("test"));
    QVERIFY(r.dataUrl() == QUrl("http://www.test.com"));
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeVisualReminder) != r);
    QVERIFY(oi.saveDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeVisualReminder).size() == 1); // should update, not add another
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeVisualReminder) == r);

    // remove
    QVERIFY(oi.removeDetail(&r));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeVisualReminder).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:41,代码来源:tst_qorganizeritemdetails.cpp

示例13: priority

void tst_QOrganizerItemDetails::priority()
{
    QOrganizerItemPriority p;
    QOrganizerItem oi;

    QVERIFY(p.isEmpty());
    p.setValue(QOrganizerItemPriority::FieldPriority, QOrganizerItemPriority::VeryHighPriority);
    QVERIFY(p.priority() == QOrganizerItemPriority::VeryHighPriority);
    QVERIFY(oi.saveDetail(&p));
    QVERIFY(oi.details(QOrganizerItemDetail::TypePriority).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypePriority) == p);

    p.setPriority(QOrganizerItemPriority::VeryLowPriority);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypePriority) != p);
    QVERIFY(oi.saveDetail(&p));
    QVERIFY(oi.details(QOrganizerItemDetail::TypePriority).size() == 1); // update shouldn't add another detail.
    QVERIFY(oi.detail(QOrganizerItemDetail::TypePriority) == p);

    QVERIFY(oi.removeDetail(&p));
    QVERIFY(oi.details(QOrganizerItemDetail::TypePriority).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:21,代码来源:tst_qorganizeritemdetails.cpp

示例14: location

void tst_QOrganizerItemDetails::location()
{
    QOrganizerItemLocation l1;
    QOrganizerItem oi;
    QVERIFY(l1.isEmpty());

    l1.setLatitude(89.999);
    QVERIFY(!l1.isEmpty());
    QVERIFY(l1.latitude() == 89.999);
    l1.setValue(QOrganizerItemLocation::FieldLatitude, -89.12345);
    QVERIFY(l1.value(QOrganizerItemLocation::FieldLatitude) == -89.12345);
    l1.setLatitude(-90.12345);
    l1.setLatitude(91);
    QVERIFY(l1.latitude() == -89.12345);

    l1.setLongitude(179);
    QVERIFY(l1.longitude() == 179);
    l1.setValue(QOrganizerItemLocation::FieldLongitude, -179.54321);
    QVERIFY(l1.value(QOrganizerItemLocation::FieldLongitude) == -179.54321);
    l1.setLongitude(180.1);
    l1.setLongitude(-180.1);
    QVERIFY(l1.longitude() == -179.54321);

    l1.setLabel("test");
    QVERIFY(l1.label() == QString("test"));

    QVERIFY(oi.details(QOrganizerItemDetail::TypeLocation).size() == 0);
    QVERIFY(oi.saveDetail(&l1));
    QVERIFY(oi.details(QOrganizerItemDetail::TypeLocation).size() == 1);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeLocation) == l1);

    l1.setLabel("test 2");
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeLocation) != l1);
    QVERIFY(oi.saveDetail(&l1)); // update.
    QVERIFY(oi.details(QOrganizerItemDetail::TypeLocation).size() == 1); // should update, not add another.
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeLocation) == l1);

    oi.removeDetail(&l1);
    QVERIFY(oi.details(QOrganizerItemDetail::TypeLocation).size() == 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:40,代码来源:tst_qorganizeritemdetails.cpp

示例15: classification

void tst_QOrganizerItemDetails::classification()
{
    QOrganizerItemClassification classification;
    QOrganizerItem oi;

    QVERIFY(classification.isEmpty());

    // setters/getters
    classification.setClassification(QOrganizerItemClassification::AccessPublic);
    QVERIFY(classification.classification() == QOrganizerItemClassification::AccessPublic);
    classification.setClassification(QOrganizerItemClassification::AccessPrivate);
    QVERIFY(classification.classification() == QOrganizerItemClassification::AccessPrivate);
    classification.setClassification(QOrganizerItemClassification::AccessConfidential);
    QVERIFY(classification.classification() == QOrganizerItemClassification::AccessConfidential);

    // add
    QCOMPARE(0, oi.details(QOrganizerItemDetail::TypeClassification).size());
    QVERIFY(oi.saveDetail(&classification));
    QCOMPARE(1, oi.details(QOrganizerItemDetail::TypeClassification).size());
    QCOMPARE(classification, static_cast<QOrganizerItemClassification>(oi.detail(QOrganizerItemDetail::TypeClassification)));

    // update
    classification.setValue(QOrganizerItemClassification::FieldClassification, QOrganizerItemClassification::AccessPrivate);
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeClassification) != classification);
    QVERIFY(oi.saveDetail(&classification));
    QCOMPARE(1, oi.details(QOrganizerItemDetail::TypeClassification).size());
    QVERIFY(oi.detail(QOrganizerItemDetail::TypeClassification) == classification);

    // try adding another, amount of details should stay the same
    QOrganizerItemClassification classification2;
    classification2.setClassification(QOrganizerItemClassification::AccessConfidential);
    QVERIFY(oi.saveDetail(&classification2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeClassification).size(), 1);

    // remove
    QVERIFY(oi.removeDetail(&classification2));
    QCOMPARE(oi.details(QOrganizerItemDetail::TypeClassification).size(), 0);
}
开发者ID:chriadam,项目名称:qtpim,代码行数:38,代码来源:tst_qorganizeritemdetails.cpp


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