本文整理汇总了C++中core::Id::withSuffix方法的典型用法代码示例。如果您正苦于以下问题:C++ Id::withSuffix方法的具体用法?C++ Id::withSuffix怎么用?C++ Id::withSuffix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::Id
的用法示例。
在下文中一共展示了Id::withSuffix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupFilterMenuItems
void FindPlugin::setupFilterMenuItems()
{
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::getObjects<IFindFilter>();
Core::Command *cmd;
Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::ActionContainer *mfindadvanced = Core::ActionManager::actionContainer(Constants::M_FIND_ADVANCED);
d->m_filterActions.clear();
bool haveEnabledFilters = false;
const Core::Id base("FindFilter.");
foreach (IFindFilter *filter, findInterfaces) {
QAction *action = new QAction(QLatin1String(" ") + filter->displayName(), this);
bool isEnabled = filter->isEnabled();
if (isEnabled)
haveEnabledFilters = true;
action->setEnabled(isEnabled);
action->setData(qVariantFromValue(filter));
cmd = Core::ActionManager::registerAction(action,
base.withSuffix(filter->id()), globalcontext);
cmd->setDefaultKeySequence(filter->defaultShortcut());
mfindadvanced->addAction(cmd);
d->m_filterActions.insert(filter, action);
connect(action, SIGNAL(triggered(bool)), this, SLOT(openFindFilter()));
connect(filter, SIGNAL(enabledChanged(bool)), this, SLOT(filterChanged()));
}
示例2: foreach
QList<Core::Id> RemoteLinuxRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{
Q_UNUSED(mode)
QList<Core::Id> result;
if (!canHandle(parent))
return result;
const Core::Id base = Core::Id(RemoteLinuxRunConfiguration::IdPrefix);
foreach (const BuildTargetInfo &bti, parent->applicationTargets().list)
result << base.withSuffix(bti.projectFilePath.toString());
result << RemoteLinuxCustomRunConfiguration::runConfigId();
return result;
}