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

Method hideColumns

src/openms_gui/source/VISUAL/TableView.cpp:169–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 }
168
169 void TableView::hideColumns(const QStringList& header_names)
170 {
171 /*
172 * Suppressing warning toSet() deprecated till Qt 5.14
173 */
174#pragma GCC diagnostic push
175#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
176 auto hset = header_names.toSet();
177#pragma GCC diagnostic pop
178 // add actions which show/hide columns
179 for (int i = 0; i != columnCount(); ++i)
180 {
181 QTableWidgetItem* ti = horizontalHeaderItem(i);
182 if (ti == nullptr)
183 {
184 continue;
185 }
186 if (hset.contains(ti->text()))
187 {
188 setColumnHidden(i, true);
189 hset.remove(ti->text());
190 }
191 }
192 if (!hset.empty())
193 {
194 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "header_names contains a column name which is unknown: " + String(hset.values().join(", ")));
195 }
196 }
197
198 void TableView::appendRow()
199 {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected