本文整理汇总了C++中QOrganizerItem::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ QOrganizerItem::isEmpty方法的具体用法?C++ QOrganizerItem::isEmpty怎么用?C++ QOrganizerItem::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QOrganizerItem
的用法示例。
在下文中一共展示了QOrganizerItem::isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupData
bool CalendarPage::setupData(const QNdefMessage message)
{
QOrganizerItem o = Util::organizerItemFromNdef(message);
if (o.isEmpty() == true) {
setCalendarItem(QOrganizerItem());
return false;
}
setCalendarItem(o);
if (isTemporary() == true) {
setDefaultName(m_info.displayLabel());
}
return true;
}
示例2: QVERIFY
QOrganizerItemLocation adr;
adr.setLabel("this is a test address");
QVERIFY(keyTest.saveDetail(&adr));
allDetails = keyTest.details();
detailKeys.clear();
foreach (const QOrganizerItemDetail& det, allDetails) {
int currKey = det.key();
QVERIFY(!detailKeys.contains(currKey));
detailKeys.append(currKey);
}
// now test for default construction sanity
QOrganizerItem oi;
// Test there are no details (apart from type) by default
QVERIFY(oi.isEmpty() == true);
QCOMPARE(oi.details().count(), 1);
QCOMPARE(oi.details(QOrganizerItemLocation::DefinitionName).count(), 0);
QCOMPARE(oi.details<QOrganizerItemLocation>().count(), 0);
QVERIFY(oi.detail(QOrganizerItemLocation::DefinitionName).isEmpty());
QVERIFY(oi.detail<QOrganizerItemLocation>().isEmpty());
QCOMPARE(oi.details(QOrganizerItemLocation::DefinitionName.latin1()).count(), 0);
QVERIFY(oi.detail(QOrganizerItemLocation::DefinitionName.latin1()).isEmpty());
QCOMPARE(oi.details(QLatin1String(QOrganizerItemLocation::DefinitionName)).count(), 0);
QVERIFY(oi.detail(QLatin1String(QOrganizerItemLocation::DefinitionName)).isEmpty());
// Test retrieving the default details (type)
QList<QOrganizerItemDetail> details = oi.details(QString());
QVERIFY(details.at(0).definitionName() == QOrganizerItemType::DefinitionName);
QOrganizerItemDetail detail = oi.detail("nonexistent");