MCPcopy Create free account
hub / github.com/MITK/MITK / Reset

Method Reset

Modules/QtWidgets/src/QmitkPropertiesTableModel.cpp:436–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436void QmitkPropertiesTableModel::Reset()
437{
438 // remove all selected properties
439 while (!m_SelectedProperties.empty())
440 {
441 this->RemoveSelectedProperty(m_SelectedProperties.size() - 1);
442 }
443
444 std::vector<PropertyDataSet> allPredicates;
445 auto propertyList = m_PropertyList.Lock();
446
447 if (propertyList.IsNotNull())
448 {
449 // first of all: collect all properties from the list
450 for (auto it = propertyList->GetMap()->begin(); it != propertyList->GetMap()->end(); it++)
451 {
452 allPredicates.push_back(*it); //% TODO
453 }
454 }
455 // make a subselection if a keyword is specified
456 if (!m_FilterKeyWord.empty())
457 {
458 std::vector<PropertyDataSet> subSelection;
459
460 for (auto it = allPredicates.begin(); it != allPredicates.end(); it++)
461 {
462 // add this to the selection if it is matched by the keyword
463 if ((*it).first.find(m_FilterKeyWord) != std::string::npos)
464 subSelection.push_back((*it));
465 }
466 allPredicates.clear();
467 allPredicates = subSelection;
468 }
469
470 PropertyDataSet tmpPropertyDataSet;
471 // add all selected now to the Model
472 for (auto it = allPredicates.begin(); it != allPredicates.end(); it++)
473 {
474 tmpPropertyDataSet = *it;
475 this->AddSelectedProperty(tmpPropertyDataSet);
476 }
477
478 // sort the list as indicated by m_SortDescending
479 this->sort(m_SortDescending);
480
481 // model was reset
482 QAbstractTableModel::beginResetModel();
483 QAbstractTableModel::endResetModel();
484}
485
486void QmitkPropertiesTableModel::SetFilterPropertiesKeyWord(std::string _FilterKeyWord)
487{

Callers 4

SetPropertyListMethod · 0.95
PropertyListDeleteMethod · 0.95
PropertyDeleteMethod · 0.95

Calls 11

AddSelectedPropertyMethod · 0.95
sortMethod · 0.95
IsNotNullMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
LockMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected