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

Function addRangeRow

src/openms_gui/source/VISUAL/DIALOGS/LayerStatisticsDialog.cpp:98–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 void addRangeRow(LayerStatisticsDialog* lsd, QTableWidget* table, int& row_i,
99 const RangeStatsType& row_name, const RangeStatsVariant& row_data,
100 const bool enable_show_button, LayerStatistics* stats)
101 {
102 addEmptyRow(table, row_i, row_name.name.c_str());
103 // get column data
104 std::array<QString, col_count> col_values = std::visit(overload{
105 [&](const RangeStatsInt& d) -> std::array<QString, col_count> { return {toStringWithLocale(d.getCount()),
106 QString::number(d.getMin()),
107 QString::number(d.getMax()),
108 QString::number(d.getAvg(), 'f', 2)}; },
109 [&](const RangeStatsDouble& d) -> std::array<QString, col_count> { return {toStringWithLocale(d.getCount()),
110 QString::number(d.getMin(), 'f', 2),
111 QString::number(d.getMax(), 'f', 2),
112 QString::number(d.getAvg(), 'f', 2)}; }
113 }, row_data);
114
115 populateRow(table, row_i, col_values);
116
117 if (enable_show_button)
118 {
119 auto button = new QPushButton(row_name.name.c_str(), table);
120 table->setCellWidget(row_i, col_count, button);
121 QObject::connect(button, &QPushButton::clicked, [=]() { showDistribution(lsd, row_name.name.c_str(), stats->getDistribution(row_name)); });
122 }
123
124 // next row
125 ++row_i;
126 }
127
128 void addCountRow(QTableWidget* table, int& row_i, const QString& row_name, const StatsCounter& row_data)
129 {

Callers 1

LayerStatisticsDialogMethod · 0.85

Calls 10

addEmptyRowFunction · 0.85
toStringWithLocaleFunction · 0.85
numberFunction · 0.85
populateRowFunction · 0.85
showDistributionFunction · 0.85
getCountMethod · 0.80
getAvgMethod · 0.80
getMinMethod · 0.45
getMaxMethod · 0.45
getDistributionMethod · 0.45

Tested by

no test coverage detected