本文整理汇总了C++中parametergrp::handle类的典型用法代码示例。如果您正苦于以下问题:C++ handle类的具体用法?C++ handle怎么用?C++ handle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了handle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGridLayout
Workbench::Workbench()
{
// Tree view
Gui::DockWindow* tree = new Gui::DockWindow(0, Gui::getMainWindow());
tree->setWindowTitle(QString::fromLatin1("Tree view"));
Gui::TreeView* treeWidget = new Gui::TreeView(tree);
treeWidget->setRootIsDecorated(false);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
treeWidget->setIndentation(hGrp->GetInt("Indentation", treeWidget->indentation()));
QGridLayout* pLayout = new QGridLayout(tree);
pLayout->setSpacing(0);
pLayout->setMargin (0);
pLayout->addWidget(treeWidget, 0, 0);
tree->setObjectName
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tree view (MVC)")));
tree->setMinimumWidth(210);
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
pDockMgr->registerDockWindow("Std_TreeViewMVC", tree);
}
示例2: load
void MacroCommand::load()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Macro");
if (hGrp->HasGroup("Macros")) {
hGrp = hGrp->GetGroup("Macros");
std::vector<Base::Reference<ParameterGrp> > macros = hGrp->GetGroups();
for (std::vector<Base::Reference<ParameterGrp> >::iterator it = macros.begin(); it!=macros.end(); ++it ) {
MacroCommand* macro = new MacroCommand((*it)->GetGroupName());
macro->setScriptName ( (*it)->GetASCII( "Script" ).c_str() );
macro->setMenuText ( (*it)->GetASCII( "Menu" ).c_str() );
macro->setToolTipText ( (*it)->GetASCII( "Tooltip" ).c_str() );
macro->setWhatsThis ( (*it)->GetASCII( "WhatsThis" ).c_str() );
macro->setStatusTip ( (*it)->GetASCII( "Statustip" ).c_str() );
if ((*it)->GetASCII("Pixmap", "nix") != "nix")
macro->setPixmap ( (*it)->GetASCII( "Pixmap" ).c_str() );
macro->setAccel ( (*it)->GetASCII( "Accel",0 ).c_str() );
Application::Instance->commandManager().addCommand( macro );
}
}
}
示例3: saveSettings
void DlgSettingsFemImp::saveSettings()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem");
hGrp->SetInt("AnalysisType", cb_analysis_type->currentIndex());
fc_analysis_working_directory->onSave();
cb_int_editor->onSave();
fc_ext_editor->onSave();
fc_ccx_binary->onSave();
fc_z88_binary->onSave();
cb_analysis_type->onSave();
sb_eigenmode_number->onSave();
dsb_eigenmode_high_limit->onSave();
dsb_eigenmode_low_limit->onSave();
cb_use_built_in_materials->onSave();
cb_use_mat_from_config_dir->onSave();
cb_use_mat_from_custom_dir->onSave();
fc_custom_mat_dir->onSave();
cb_restore_result_dialog->onSave();
}
示例4: on_buttonReset_clicked
/** Resets the accelerator of the selected command to the default. */
void DlgCustomKeyboardImp::on_buttonReset_clicked()
{
QTreeWidgetItem* item = commandTreeWidget->currentItem();
if (!item)
return;
QVariant data = item->data(1, Qt::UserRole);
QByteArray name = data.toByteArray(); // command name
CommandManager & cCmdMgr = Application::Instance->commandManager();
Command* cmd = cCmdMgr.getCommandByName(name.constData());
if (cmd && cmd->getAction()) {
cmd->getAction()->setShortcut(QString::fromLatin1(cmd->getAccel()));
QString txt = cmd->getAction()->shortcut().toString(QKeySequence::NativeText);
accelLineEditShortcut->setText((txt.isEmpty() ? tr("none") : txt));
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut");
hGrp->RemoveASCII(name.constData());
}
buttonReset->setEnabled( false );
}
示例5: loadSettings
void DlgSettingsFemImp::loadSettings()
{
fc_ccx_working_directory->onRestore();
cb_int_editor->onRestore();
fc_ext_editor->onRestore();
fc_ccx_binary->onRestore();
cb_analysis_type->onRestore();
sb_eigenmode_number->onRestore();
dsb_eigenmode_high_limit->onRestore();
dsb_eigenmode_low_limit->onRestore();
cb_use_built_in_materials->onRestore();
cb_use_mat_from_config_dir->onRestore();
cb_use_mat_from_custom_dir->onRestore();
fc_custom_mat_dir->onRestore();
cb_restore_result_dialog->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem");
int index = hGrp->GetInt("AnalysisType", 0);
if (index > -1) cb_analysis_type->setCurrentIndex(index);
}
示例6: col
ViewProviderDatum::ViewProviderDatum()
{
pShapeSep = new SoSeparator();
pShapeSep->ref();
pPickStyle = new SoPickStyle();
pPickStyle->ref();
DisplayMode.setStatus(App::Property::Hidden, true);
// set default color for datums (golden yellow with 60% transparency)
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath (
"User parameter:BaseApp/Preferences/Mod/PartDesign");
unsigned long shcol = hGrp->GetUnsigned ( "DefaultDatumColor", 0xFFD70099 );
App::Color col ( (uint32_t) shcol );
ShapeColor.setValue ( col );
Transparency.setValue (col.a * 100);
oldWb = "";
oldTip = NULL;
}
示例7: DockWindow
CombiView::CombiView(Gui::Document* pcDocument, QWidget *parent)
: DockWindow(pcDocument,parent), oldTabIndex(0)
{
setWindowTitle(tr("CombiView"));
QGridLayout* pLayout = new QGridLayout(this);
pLayout->setSpacing( 0 );
pLayout->setMargin ( 0 );
// tabs to switch between Tree/Properties and TaskPanel
tabs = new QTabWidget ();
tabs->setObjectName(QString::fromUtf8("combiTab"));
tabs->setTabPosition(QTabWidget::North);
pLayout->addWidget( tabs, 0, 0 );
// splitter between tree and property view
QSplitter *splitter = new QSplitter();
splitter->setOrientation(Qt::Vertical);
// tree widget
tree = new TreeWidget(this);
//tree->setRootIsDecorated(false);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
tree->setIndentation(hGrp->GetInt("Indentation", tree->indentation()));
splitter->addWidget(tree);
// property view
prop = new PropertyView(this);
splitter->addWidget(prop);
tabs->addTab(splitter,trUtf8("Model"));
// task panel
taskPanel = new Gui::TaskView::TaskView(this);
tabs->addTab(taskPanel, trUtf8("Tasks"));
// task panel
//projectView = new Gui::ProjectWidget(this);
//tabs->addTab(projectView, trUtf8("Project"));
}
示例8: setupCustomShortcuts
void Workbench::setupCustomShortcuts() const
{
// Assigns user defined accelerators
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter();
if ( hGrp->HasGroup("Shortcut") ) {
hGrp = hGrp->GetGroup("Shortcut");
// Get all user defined shortcuts
const CommandManager& cCmdMgr = Application::Instance->commandManager();
std::vector<std::pair<std::string,std::string> > items = hGrp->GetASCIIMap();
for ( std::vector<std::pair<std::string,std::string> >::iterator it = items.begin(); it != items.end(); ++it )
{
Command* cmd = cCmdMgr.getCommandByName(it->first.c_str());
if (cmd && cmd->getAction())
{
// may be UTF-8 encoded
QString str = QString::fromUtf8(it->second.c_str());
QKeySequence shortcut = str;
cmd->getAction()->setShortcut(shortcut);
}
}
}
}
示例9: updateDefaultMethodParameters
void TaskSketcherSolverAdvanced::updateDefaultMethodParameters(void)
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/SolverAdvanced");
switch(ui->comboBoxDefaultSolver->currentIndex())
{
case 0: // BFGS
ui->labelSolverParam1->setText(QString::fromLatin1(""));
ui->labelSolverParam2->setText(QString::fromLatin1(""));
ui->labelSolverParam3->setText(QString::fromLatin1(""));
ui->lineEditSolverParam1->clear();
ui->lineEditSolverParam2->clear();
ui->lineEditSolverParam3->clear();
ui->lineEditSolverParam1->setDisabled(true);
ui->lineEditSolverParam2->setDisabled(true);
ui->lineEditSolverParam3->setDisabled(true);
break;
case 1: // LM
{
ui->labelSolverParam1->setText(QString::fromLatin1("Eps"));
ui->labelSolverParam2->setText(QString::fromLatin1("Eps1"));
ui->labelSolverParam3->setText(QString::fromLatin1("Tau"));
ui->lineEditSolverParam1->setEnabled(true);
ui->lineEditSolverParam2->setEnabled(true);
ui->lineEditSolverParam3->setEnabled(true);
double eps = ::atof(hGrp->GetASCII("LM_eps",QString::number(LM_EPS).toUtf8()).c_str());
double eps1 = ::atof(hGrp->GetASCII("LM_eps1",QString::number(LM_EPS1).toUtf8()).c_str());
double tau = ::atof(hGrp->GetASCII("LM_tau",QString::number(LM_TAU).toUtf8()).c_str());
ui->lineEditSolverParam1->setText(QString::number(eps).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
ui->lineEditSolverParam2->setText(QString::number(eps1).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
ui->lineEditSolverParam3->setText(QString::number(tau).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
sketchView->getSketchObject()->getSolvedSketch().setLM_eps(eps);
sketchView->getSketchObject()->getSolvedSketch().setLM_eps1(eps1);
sketchView->getSketchObject()->getSolvedSketch().setLM_tau(tau);
break;
}
case 2: // DogLeg
{
ui->labelSolverParam1->setText(QString::fromLatin1("Tolg"));
ui->labelSolverParam2->setText(QString::fromLatin1("Tolx"));
ui->labelSolverParam3->setText(QString::fromLatin1("Tolf"));
ui->lineEditSolverParam1->setEnabled(true);
ui->lineEditSolverParam2->setEnabled(true);
ui->lineEditSolverParam3->setEnabled(true);
double tolg = ::atof(hGrp->GetASCII("DL_tolg",QString::number(DL_TOLG).toUtf8()).c_str());
double tolx = ::atof(hGrp->GetASCII("DL_tolx",QString::number(DL_TOLX).toUtf8()).c_str());
double tolf = ::atof(hGrp->GetASCII("DL_tolf",QString::number(DL_TOLF).toUtf8()).c_str());
ui->lineEditSolverParam1->setText(QString::number(tolg).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
ui->lineEditSolverParam2->setText(QString::number(tolx).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
ui->lineEditSolverParam3->setText(QString::number(tolf).remove(QString::fromLatin1("+").replace(QString::fromLatin1("e0"),QString::fromLatin1("E")).toUpper()));
sketchView->getSketchObject()->getSolvedSketch().setDL_tolg(tolg);
sketchView->getSketchObject()->getSolvedSketch().setDL_tolf(tolf);
sketchView->getSketchObject()->getSolvedSketch().setDL_tolx(tolx);
break;
}
}
}
示例10: saveSettings
void SketcherSettings::saveSettings()
{
// Sketcher
ui->SketchEdgeColor->onSave();
ui->SketchVertexColor->onSave();
ui->EditedEdgeColor->onSave();
ui->EditedVertexColor->onSave();
ui->ConstructionColor->onSave();
ui->ExternalColor->onSave();
ui->FullyConstrainedColor->onSave();
ui->ConstrainedColor->onSave();
ui->NonDrivingConstraintColor->onSave();
ui->DatumColor->onSave();
ui->SketcherDatumWidth->onSave();
ui->DefaultSketcherVertexWidth->onSave();
ui->DefaultSketcherLineWidth->onSave();
ui->CursorTextColor->onSave();
// Sketch editing
ui->EditSketcherFontSize->onSave();
ui->dialogOnDistanceConstraint->onSave();
ui->continueMode->onSave();
ui->checkBoxAdvancedSolverTaskBox->onSave();
form->saveSettings();
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
int markerSize = ui->EditSketcherMarkerSize->itemData(ui->EditSketcherMarkerSize->currentIndex()).toInt();
hViewGrp->SetInt("EditSketcherMarkerSize", markerSize);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
QVariant data = ui->comboBox->itemData(ui->comboBox->currentIndex());
int pattern = data.toInt();
hGrp->SetInt("GridLinePattern", pattern);
}
示例11: loadParameter
bool ViewProviderPartExt::loadParameter()
{
bool changed = false;
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Part");
float deviation = hGrp->GetFloat("MeshDeviation",0.2);
bool novertexnormals = hGrp->GetBool("NoPerVertexNormals",false);
bool qualitynormals = hGrp->GetBool("QualityNormals",false);
if (Deviation.getValue() != deviation) {
Deviation.setValue(deviation);
changed = true;
}
if (this->noPerVertexNormals != novertexnormals) {
this->noPerVertexNormals = novertexnormals;
changed = true;
}
if (this->qualityNormals != qualitynormals) {
this->qualityNormals = qualitynormals;
changed = true;
}
return changed;
}
示例12: run
void MacroManager::run(MacroType eType, const char *sName)
{
Q_UNUSED(eType);
try {
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("OutputWindow");
PyObject* pyout = hGrp->GetBool("RedirectPythonOutput",true) ? new OutputStdout : 0;
PyObject* pyerr = hGrp->GetBool("RedirectPythonErrors",true) ? new OutputStderr : 0;
PythonRedirector std_out("stdout",pyout);
PythonRedirector std_err("stderr",pyerr);
//The given path name is expected to be Utf-8
Base::Interpreter().runFile(sName, this->localEnv);
}
catch (const Base::SystemExitException&) {
throw;
}
catch (const Base::PyException& e) {
e.ReportException();
}
catch (const Base::Exception& e) {
qWarning("%s",e.what());
}
}
示例13: setOptions
void ImpExpDxfWrite::setOptions(void)
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str());
optionMaxLength = hGrp->GetFloat("maxsegmentlength",5.0);
optionExpPoints = hGrp->GetBool("ExportPoints",false);
m_version = hGrp->GetInt("DxfVersionOut",14);
optionPolyLine = hGrp->GetBool("DiscretizeEllipses",false);
m_polyOverride = hGrp->GetBool("DiscretizeEllipses",false);
setDataDir(App::Application::getResourceDir() + "Mod/Import/DxfPlate/");
}
示例14: 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());
}
}
}
}
}
示例15: importCustomToolbars
void DlgCustomToolbars::importCustomToolbars(const QByteArray& name)
{
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Workbench");
const char* subgroup = (type == Toolbar ? "Toolbar" : "Toolboxbar");
if (!hGrp->HasGroup(name.constData()))
return;
hGrp = hGrp->GetGroup(name.constData());
if (!hGrp->HasGroup(subgroup))
return;
hGrp = hGrp->GetGroup(subgroup);
std::string separator = "Separator";
std::vector<Base::Reference<ParameterGrp> > hGrps = hGrp->GetGroups();
CommandManager& rMgr = Application::Instance->commandManager();
for (std::vector<Base::Reference<ParameterGrp> >::iterator it = hGrps.begin(); it != hGrps.end(); ++it) {
// create a toplevel item
QTreeWidgetItem* toplevel = new QTreeWidgetItem(toolbarTreeWidget);
bool active = (*it)->GetBool("Active", true);
toplevel->setCheckState(0, (active ? Qt::Checked : Qt::Unchecked));
// get the elements of the subgroups
std::vector<std::pair<std::string,std::string> > items = (*it)->GetASCIIMap();
for (std::vector<std::pair<std::string,std::string> >::iterator it2 = items.begin(); it2 != items.end(); ++it2) {
// since we have stored the separators to the user parameters as (key, pair) we had to
// make sure to use a unique key because otherwise we cannot store more than
// one.
if (it2->first.substr(0, separator.size()) == separator) {
QTreeWidgetItem* item = new QTreeWidgetItem(toplevel);
item->setText(0, tr("<Separator>"));
item->setData(0, Qt::UserRole, QByteArray("Separator"));
item->setSizeHint(0, QSize(32, 32));
}
else if (it2->first == "Name") {
QString toolbarName = QString::fromUtf8(it2->second.c_str());
toplevel->setText(0, toolbarName);
}
else {
Command* pCmd = rMgr.getCommandByName(it2->first.c_str());
if (pCmd) {
// command name
QTreeWidgetItem* item = new QTreeWidgetItem(toplevel);
item->setText(0, qApp->translate(pCmd->className(), pCmd->getMenuText()));
item->setData(0, Qt::UserRole, QByteArray(it2->first.c_str()));
if (pCmd->getPixmap())
item->setIcon(0, BitmapFactory().iconFromTheme(pCmd->getPixmap()));
item->setSizeHint(0, QSize(32, 32));
}
}
}
}
}