| 86 | } |
| 87 | |
| 88 | std::string QmitkFitParameterWidget::streamModelToString() const |
| 89 | { |
| 90 | std::ostringstream stream; |
| 91 | stream.imbue(std::locale("C")); |
| 92 | |
| 93 | //head line |
| 94 | const auto colCount = this->m_InternalModel->columnCount(); |
| 95 | for (int col = 0; col < colCount; ++col) |
| 96 | { |
| 97 | if (col != 0) |
| 98 | { |
| 99 | stream << ","; |
| 100 | } |
| 101 | stream << SanatizeString(m_InternalModel->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString().toStdString()); |
| 102 | } |
| 103 | stream << std::endl; |
| 104 | |
| 105 | //content |
| 106 | const auto rowCount = this->m_InternalModel->rowCount(); |
| 107 | for (int row = 0; row < rowCount; ++row) |
| 108 | { |
| 109 | QModelIndex index = this->m_InternalModel->index(row, 0); |
| 110 | |
| 111 | const auto childCount = this->m_InternalModel->rowCount(index); |
| 112 | |
| 113 | if (childCount == 0) |
| 114 | { |
| 115 | for (int col = 0; col < colCount; ++col) |
| 116 | { |
| 117 | if (col != 0) |
| 118 | { |
| 119 | stream << ","; |
| 120 | } |
| 121 | stream << SanatizeString(m_InternalModel->data(index.siblingAtColumn(col), Qt::DisplayRole).toString().toStdString()); |
| 122 | } |
| 123 | stream << std::endl; |
| 124 | } |
| 125 | else |
| 126 | { |
| 127 | mitkThrow() << "Missing implementation for multiple fits."; |
| 128 | //TODO FIT REFACTOR |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | return stream.str(); |
| 133 | } |
| 134 | |
| 135 | void QmitkFitParameterWidget::OnClipboardResultsButtonClicked() const |
| 136 | { |
no test coverage detected