given an item, goes up the tree to the root and collects indices in to the OSWData for each level
| 32 | |
| 33 | /// given an item, goes up the tree to the root and collects indices in to the OSWData for each level |
| 34 | OSWIndexTrace getTrace(QTreeWidgetItem* current) |
| 35 | { |
| 36 | OSWIndexTrace trace; |
| 37 | |
| 38 | while (current != nullptr) |
| 39 | { |
| 40 | OSWHierarchy::Level level = OSWHierarchy::Level(current->data(Clmn::INDEX, Qt::UserRole).toInt()); |
| 41 | int index = current->data(Clmn::INDEX, Qt::DisplayRole).toInt(); |
| 42 | |
| 43 | if (trace.lowest == OSWHierarchy::Level::SIZE_OF_VALUES) |
| 44 | { // set to level of first current |
| 45 | trace.lowest = level; |
| 46 | } |
| 47 | switch (level) |
| 48 | { |
| 49 | case OSWHierarchy::Level::PROTEIN: |
| 50 | trace.idx_prot = index; |
| 51 | break; |
| 52 | case OSWHierarchy::Level::PEPTIDE: |
| 53 | trace.idx_pep = index; |
| 54 | break; |
| 55 | case OSWHierarchy::Level::FEATURE: |
| 56 | trace.idx_feat = index; |
| 57 | break; |
| 58 | case OSWHierarchy::Level::TRANSITION: |
| 59 | trace.idx_trans = index; |
| 60 | break; |
| 61 | default: |
| 62 | throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); |
| 63 | } |
| 64 | // up one level |
| 65 | current = current->parent(); |
| 66 | } |
| 67 | return trace; |
| 68 | } |
| 69 | |
| 70 | DIATreeTab::DIATreeTab(QWidget* parent) : |
| 71 | QWidget(parent) |
no test coverage detected