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

Method hideColumns

src/openms_gui/source/VISUAL/TreeView.cpp:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void TreeView::hideColumns(const QStringList& header_names)
60 {
61 /*
62 * Suppressing warning toSet() deprecated till Qt 5.14
63 */
64#pragma GCC diagnostic push
65#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
66 auto hset = header_names.toSet();
67#pragma GCC diagnostic pop
68 // add actions which show/hide columns
69 const auto& header = this->headerItem();
70
71 for (int i = 0; i < header->columnCount(); ++i)
72 {
73 if (hset.contains(header->text(i)))
74 {
75 setColumnHidden(i, true);
76 hset.remove(header->text(i));
77 }
78 }
79 if (!hset.empty())
80 {
81 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "header_names contains a column name which is unknown: " + String(hset.values().join(", ")));
82 }
83 }
84
85 QStringList TreeView::getHeaderNames(const WidgetHeader which) const
86 {

Callers 1

updateEntries_Method · 0.45

Calls 5

StringClass · 0.50
containsMethod · 0.45
removeMethod · 0.45
emptyMethod · 0.45
valuesMethod · 0.45

Tested by 1

updateEntries_Method · 0.36