MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / load

Method load

src/openms_gui/source/VISUAL/ParamEditor.cpp:475–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473 }
474
475 void ParamEditor::load(Param & param)
476 {
477 param_ = &param;
478
479 tree_->clear();
480
481 QTreeWidgetItem * parent = tree_->invisibleRootItem();
482 QTreeWidgetItem * item = nullptr;
483
484 bool has_advanced_item = false; // will be true if @p param has any advanced items; if still false, we disable the 'show advanced checkbox'
485
486 for (Param::ParamIterator it = param.begin(); it != param.end(); ++it)
487 {
488 //********handle opened/closed nodes********
489 const std::vector<Param::ParamIterator::TraceInfo> & trace = it.getTrace();
490 for (const Param::ParamIterator::TraceInfo& par : trace)
491 {
492 if (par.opened) //opened node
493 {
494 item = new QTreeWidgetItem(parent);
495 //name
496 item->setText(0, String(par.name).toQString());
497 item->setForeground(0, Qt::darkGray); // color of nodes with children
498
499 //description
500 item->setData(1, Qt::UserRole, String(par.description).toQString());
501 //role
502 item->setData(0, Qt::UserRole, NODE);
503 //flags
504 if (param_ != nullptr)
505 {
506 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
507 }
508 else
509 {
510 item->setFlags(Qt::ItemIsEnabled);
511 }
512 parent = item;
513 }
514 else //closed node
515 {
516 parent = parent->parent();
517 if (parent == nullptr)
518 {
519 parent = tree_->invisibleRootItem();
520 }
521 }
522 }
523
524 //********handle item********
525 item = new QTreeWidgetItem(parent);
526
527 // grey out non-editable columns (leaf nodes)
528 bool is_required = it->tags.find("required") != it->tags.end();
529 if (is_required) // special color for required parameters
530 {
531 item->setForeground(0, QColor(255, 140, 0, 255)); // orange
532 item->setForeground(2, QColor(255, 140, 0, 255));

Callers 5

annotateWorker_Method · 0.45
visualize_Method · 0.45
getParamFromIni_Method · 0.45
SequenceVisualizerMethod · 0.45
initParam_Method · 0.45

Calls 15

QColorClass · 0.85
toStringListFunction · 0.85
concatenateFunction · 0.85
setTextMethod · 0.80
setFlagsMethod · 0.80
countMethod · 0.80
toStringVectorMethod · 0.80
toIntVectorMethod · 0.80
toDoubleVectorMethod · 0.80
prefixMethod · 0.80
StringClass · 0.50
QStringClass · 0.50

Tested by

no test coverage detected