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


C++ Id::uniqueIdentifier方法代码示例

本文整理汇总了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;
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:12,代码来源:taskmodel.cpp

示例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);
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:26,代码来源:taskwindow.cpp

示例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 {
开发者ID:CNOT,项目名称:julia-studio,代码行数:11,代码来源:taskmodel.cpp

示例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);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:15,代码来源:taskwindow.cpp

示例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;
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:46,代码来源:taskmodel.cpp

示例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);
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:21,代码来源:taskwindow.cpp


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