本文整理汇总了C++中core::Id::uniqueIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ Id::uniqueIdentifier方法的具体用法?C++ Id::uniqueIdentifier怎么用?C++ Id::uniqueIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::Id
的用法示例。
在下文中一共展示了Id::uniqueIdentifier方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
QList<Task> TaskModel::tasks(const Core::Id &categoryId) const
{
if (categoryId.uniqueIdentifier() == 0)
return m_tasks;
QList<Task> taskList;
foreach (const Task &t, m_tasks) {
if (t.category.uniqueIdentifier() == categoryId.uniqueIdentifier())
taskList.append(t);
}
return taskList;
}
示例2: setCategoryVisibility
void TaskWindow::setCategoryVisibility(const Core::Id &categoryId, bool visible)
{
if (categoryId.uniqueIdentifier() == 0)
return;
QList<Core::Id> categories = d->m_filter->filteredCategories();
if (visible) {
categories.removeOne(categoryId);
} else {
categories.append(categoryId);
}
d->m_filter->setFilteredCategories(categories);
int count = 0;
if (d->m_filter->filterIncludesErrors())
count += d->m_model->errorTaskCount(categoryId);
if (d->m_filter->filterIncludesWarnings())
count += d->m_model->warningTaskCount(categoryId);
if (visible)
d->m_badgeCount += count;
else
d->m_badgeCount -= count;
setBadgeNumber(d->m_badgeCount);
}
示例3: clearTasks
void TaskModel::clearTasks(const Core::Id &categoryId)
{
if (categoryId.uniqueIdentifier() == 0) {
if (m_tasks.count() == 0)
return;
beginRemoveRows(QModelIndex(), 0, m_tasks.count() -1);
m_tasks.clear();
foreach (const Core::Id &key, m_categories.keys())
m_categories[key].clear();
endRemoveRows();
} else {
示例4: setCategoryVisibility
void TaskWindow::setCategoryVisibility(const Core::Id &categoryId, bool visible)
{
if (categoryId.uniqueIdentifier() == 0)
return;
QList<Core::Id> categories = d->m_filter->filteredCategories();
if (visible) {
categories.removeOne(categoryId);
} else {
categories.append(categoryId);
}
d->m_filter->setFilteredCategories(categories);
}
示例5: clearTasks
void TaskModel::clearTasks(const Core::Id &categoryId)
{
typedef QHash<Core::Id,CategoryData>::ConstIterator IdCategoryConstIt;
if (categoryId.uniqueIdentifier() == 0) {
if (m_tasks.count() == 0)
return;
beginRemoveRows(QModelIndex(), 0, m_tasks.count() -1);
m_tasks.clear();
const IdCategoryConstIt cend = m_categories.constEnd();
for (IdCategoryConstIt it = m_categories.constBegin(); it != cend; ++it)
m_categories[it.key()].clear();
endRemoveRows();
} else {
int index = 0;
int start = 0;
CategoryData &global = m_categories[Core::Id()];
CategoryData &cat = m_categories[categoryId];
while (index < m_tasks.count()) {
while (index < m_tasks.count() && m_tasks.at(index).category != categoryId) {
++start;
++index;
}
if (index == m_tasks.count())
break;
while (index < m_tasks.count() && m_tasks.at(index).category == categoryId)
++index;
// Index is now on the first non category
beginRemoveRows(QModelIndex(), start, index - 1);
for (int i = start; i < index; ++i) {
global.removeTask(m_tasks.at(i));
cat.removeTask(m_tasks.at(i));
}
m_tasks.erase(m_tasks.begin() + start, m_tasks.begin() + index);
endRemoveRows();
index = start;
}
}
m_maxSizeOfFileName = 0;
m_lastMaxSizeIndex = 0;
}
示例6: clearTasks
void TaskWindow::clearTasks(const Core::Id &categoryId)
{
if (categoryId.uniqueIdentifier() != 0 && !d->m_filter->filteredCategories().contains(categoryId)) {
if (d->m_filter->filterIncludesErrors())
d->m_badgeCount -= d->m_model->errorTaskCount(categoryId);
if (d->m_filter->filterIncludesWarnings())
d->m_badgeCount -= d->m_model->warningTaskCount(categoryId);
if (d->m_filter->filterIncludesUnknowns())
d->m_badgeCount -= d->m_model->unknownTaskCount(categoryId);
} else {
d->m_badgeCount = 0;
}
d->m_model->clearTasks(categoryId);
emit tasksChanged();
emit tasksCleared();
navigateStateChanged();
setBadgeNumber(d->m_badgeCount);
}