| 82 | }; |
| 83 | |
| 84 | QVariant QmitkImageStatisticsTreeItem::data(int column) const |
| 85 | { |
| 86 | QVariant result; |
| 87 | if (column > 0 && !m_statisticNames.empty()) |
| 88 | { |
| 89 | if (column - 1 < static_cast<int>(m_statisticNames.size())) |
| 90 | { |
| 91 | if (m_IsWIP) |
| 92 | { |
| 93 | result = QVariant(QString("...")); |
| 94 | } |
| 95 | else if (m_NA) |
| 96 | { |
| 97 | result = QVariant(QString("N/A")); |
| 98 | } |
| 99 | else |
| 100 | { |
| 101 | auto statisticKey = m_statisticNames.at(column - 1); |
| 102 | if (m_statistics.HasStatistic(statisticKey)) |
| 103 | { |
| 104 | return boost::apply_visitor(StatValueVisitor(), m_statistics.GetValueNonConverted(statisticKey)); |
| 105 | } |
| 106 | else |
| 107 | { |
| 108 | return QVariant(); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | else |
| 113 | { |
| 114 | return QVariant(); |
| 115 | } |
| 116 | } |
| 117 | else if (column == 0) |
| 118 | { |
| 119 | result = m_ItemText; |
| 120 | } |
| 121 | return result; |
| 122 | } |
| 123 | |
| 124 | QmitkImageStatisticsTreeItem *QmitkImageStatisticsTreeItem::parentItem() |
| 125 | { |
no test coverage detected