本文整理汇总了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();
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}