本文整理汇总了C++中QOrganizerItem::id方法的典型用法代码示例。如果您正苦于以下问题:C++ QOrganizerItem::id方法的具体用法?C++ QOrganizerItem::id怎么用?C++ QOrganizerItem::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QOrganizerItem
的用法示例。
在下文中一共展示了QOrganizerItem::id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayLabel
// test saving of a detail with an empty field.
QOrganizerItemLocation four;
four.setLabel("");
oi.saveDetail(&four);
QVERIFY(oi.details(QOrganizerItemLocation::DefinitionName).count() == 2);
QVERIFY(!four.variantValues().isEmpty()); // an empty qstring is not invalid; make sure it exists in the detail.
// ensure that clearing a contact's details works correctly
QOrganizerItemPriority priorityDetail;
priorityDetail.setPriority(QOrganizerItemPriority::VeryHighPriority);
oi.saveDetail(&priorityDetail);
QCOMPARE(oi.detail(QOrganizerItemPriority::DefinitionName).value(QOrganizerItemPriority::FieldPriority).toInt(), static_cast<int>(QOrganizerItemPriority::VeryHighPriority));
QVERIFY(oi.details().size() > 0);
QVERIFY(!oi.isEmpty());
QOrganizerItemId oldId = oi.id();
oi.clearDetails();
QCOMPARE(oi.details().size(), 1); // always has an item type.
QCOMPARE(oi.detail(QOrganizerItemPriority::DefinitionName).value(QOrganizerItemPriority::FieldPriority), QString());
QVERIFY(oi.isEmpty());
QCOMPARE(oi.id(), oldId); // id shouldn't change.
}
void tst_QOrganizerItem::displayLabel()
{
QOrganizerItem oi;
QString label = oi.displayLabel();
QVERIFY(label.isEmpty());
oi.setDisplayLabel("Test Event Display Label");
QVERIFY(oi.displayLabel() == QString("Test Event Display Label"));