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


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

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


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

示例1: d

IDevice::IDevice(const QString &type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate)
{
    d->type = type;
    d->origin = origin;
    QTC_CHECK(origin == ManuallyAdded || id.isValid());
    d->id = id.isValid() ? id : newId();
}
开发者ID:gaoxiaojun,项目名称:qtcreator,代码行数:7,代码来源:idevice.cpp

示例2: setCMakeTool

void CMakeKitInformation::setCMakeTool(Kit *k, const Core::Id id)
{
    const Core::Id toSet = id.isValid() ? id : defaultCMakeToolId();
    QTC_ASSERT(!id.isValid() || CMakeToolManager::findById(toSet), return);
    if (k)
        k->setValue(TOOL_ID, toSet.toSetting());
}
开发者ID:jaakristioja,项目名称:qt-creator,代码行数:7,代码来源:cmakekitinformation.cpp

示例3: codeModelSettings

static Core::Id configIdForProject(ClangProjectSettings &projectSettings)
{
    if (projectSettings.useGlobalConfig())
        return CppTools::codeModelSettings()->clangDiagnosticConfigId();
    Core::Id configId = projectSettings.warningConfigId();
    if (!configId.isValid()) {
        configId = CppTools::codeModelSettings()->clangDiagnosticConfigId();
        projectSettings.setWarningConfigId(configId);
    }
    return configId;
}
开发者ID:kai66673,项目名称:qt-creator,代码行数:11,代码来源:clangprojectsettingswidget.cpp

示例4: foreach

QList<Task> TaskModel::tasks(Core::Id categoryId) const
{
    if (!categoryId.isValid())
        return m_tasks;

    QList<Task> taskList;
    foreach (const Task &t, m_tasks) {
        if (t.category == categoryId)
            taskList.append(t);
    }
    return taskList;
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:12,代码来源:taskmodel.cpp

示例5: toUserOutput

KitInformation::ItemList DeviceTypeKitInformation::toUserOutput(Kit *k) const
{
    Core::Id type = deviceTypeId(k);
    QString typeDisplayName = tr("Unknown device type");
    if (type.isValid()) {
        QList<IDeviceFactory *> factories
                = ExtensionSystem::PluginManager::instance()->getObjects<IDeviceFactory>();
        foreach (IDeviceFactory *factory, factories) {
            if (factory->availableCreationIds().contains(type)) {
                typeDisplayName = factory->displayNameForId(type);
                break;
            }
        }
    }
开发者ID:syntheticpp,项目名称:qt-creator,代码行数:14,代码来源:kitinformation.cpp

示例6: clearTasks

void TaskModel::clearTasks(Core::Id categoryId)
{
    typedef QHash<Core::Id,CategoryData>::ConstIterator IdCategoryConstIt;

    if (!categoryId.isValid()) {
        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:qtproject,项目名称:qt-creator,代码行数:46,代码来源:taskmodel.cpp

示例7: addTargetSetupPage

int BaseQmakeProjectWizardDialog::addTargetSetupPage(int id)
{
    m_targetSetupPage = new ProjectExplorer::TargetSetupPage;
    const Core::Id platform = selectedPlatform();
    QSet<Core::Id> features = { QtSupport::Constants::FEATURE_DESKTOP };
    if (!platform.isValid())
        m_targetSetupPage->setPreferredKitMatcher(QtKitInformation::qtVersionMatcher(features));
    else
        m_targetSetupPage->setPreferredKitMatcher(QtKitInformation::platformMatcher(platform));

    m_targetSetupPage->setRequiredKitMatcher(QtKitInformation::qtVersionMatcher(requiredFeatures()));

    resize(900, 450);
    if (id >= 0)
        setPage(id, m_targetSetupPage);
    else
        id = addPage(m_targetSetupPage);

    return id;
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:20,代码来源:qtwizard.cpp

示例8:

RunControl *IosRunControlFactory::create(RunConfiguration *runConfig,
                                        ProjectExplorer::RunMode mode, QString *errorMessage)
{
    Q_ASSERT(canRun(runConfig, mode));
    IosRunConfiguration *rc = qobject_cast<IosRunConfiguration *>(runConfig);
    Q_ASSERT(rc);
    RunControl *res = 0;
    Core::Id devId = ProjectExplorer::DeviceKitInformation::deviceId(rc->target()->kit());
    // The device can only run an application at a time, if an app is running stop it.
    if (m_activeRunControls.contains(devId)) {
        if (QPointer<ProjectExplorer::RunControl> activeRunControl = m_activeRunControls[devId])
            activeRunControl->stop();
        m_activeRunControls.remove(devId);
    }
    if (mode == NormalRunMode)
        res = new Ios::Internal::IosRunControl(rc);
    else
        res = IosDebugSupport::createDebugRunControl(rc, errorMessage);
    if (devId.isValid())
        m_activeRunControls[devId] = res;
    return res;
}
开发者ID:Herysutrisno,项目名称:qt-creator,代码行数:22,代码来源:iosrunfactories.cpp


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