本文整理汇总了C++中parametergrp::handle::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ handle::Clear方法的具体用法?C++ handle::Clear怎么用?C++ handle::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parametergrp::handle
的用法示例。
在下文中一共展示了handle::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save_workbenches
void DlgWorkbenchesImp::save_workbenches()
{
QString enabled_wbs;
QString disabled_wbs;
ParameterGrp::handle hGrp;
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches");
hGrp->Clear();
if (lw_enabled_workbenches->count() == 0) {
enabled_wbs.append(QString::fromLatin1("NoneWorkbench"));
} else {
for (int i = 0; i < lw_enabled_workbenches->count(); i++) {
QVariant item_data = lw_enabled_workbenches->item(i)->data(Qt::UserRole);
QString name = item_data.toString();
enabled_wbs.append(name + QString::fromLatin1(","));
}
}
hGrp->SetASCII("Enabled", enabled_wbs.toLatin1());
for (int i = 0; i < lw_disabled_workbenches->count(); i++) {
QVariant item_data = lw_disabled_workbenches->item(i)->data(Qt::UserRole);
QString name = item_data.toString();
disabled_wbs.append(name + QString::fromLatin1(","));
}
hGrp->SetASCII("Disabled", disabled_wbs.toLatin1());
}
示例2: exportCustomToolbars
void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench)
{
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Workbench");
const char* subgroup = (type == Toolbar ? "Toolbar" : "Toolboxbar");
hGrp = hGrp->GetGroup(workbench.constData())->GetGroup(subgroup);
hGrp->Clear();
CommandManager& rMgr = Application::Instance->commandManager();
for (int i=0; i<toolbarTreeWidget->topLevelItemCount(); i++) {
QTreeWidgetItem* toplevel = toolbarTreeWidget->topLevelItem(i);
QString groupName = QString::fromLatin1("Custom_%1").arg(i+1);
QByteArray toolbarName = toplevel->text(0).toUtf8();
ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toLatin1());
hToolGrp->SetASCII("Name", toolbarName.constData());
hToolGrp->SetBool("Active", toplevel->checkState(0) == Qt::Checked);
// since we store the separators to the user parameters as (key, pair) we must
// make sure to use a unique key because otherwise we cannot store more than
// one.
int suffixSeparator = 1;
for (int j=0; j<toplevel->childCount(); j++) {
QTreeWidgetItem* child = toplevel->child(j);
QByteArray commandName = child->data(0, Qt::UserRole).toByteArray();
if (commandName == "Separator") {
QByteArray key = commandName + QByteArray::number(suffixSeparator);
suffixSeparator++;
hToolGrp->SetASCII(key, commandName);
}
else {
Command* pCmd = rMgr.getCommandByName(commandName);
if (pCmd) {
hToolGrp->SetASCII(pCmd->getName(), pCmd->getAppModuleName());
}
}
}
}
}