MCPcopy Create free account
hub / github.com/MITK/MITK / StreamModelToString

Method StreamModelToString

Modules/ModelFitUI/src/QmitkFitPlotDataWidget.cpp:67–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67std::string QmitkFitPlotDataWidget::StreamModelToString() const
68{
69 std::ostringstream stream;
70 stream.imbue(std::locale("C"));
71
72 //head line
73 const auto colCount = this->m_InternalModel->columnCount();
74 for (int col = 0; col < colCount; ++col)
75 {
76 if (col != 0)
77 {
78 stream << ",";
79 }
80 stream << SanatizeString(m_InternalModel->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString().toStdString());
81 }
82 stream << std::endl;
83
84 //content
85 const auto rowCount = this->m_InternalModel->rowCount();
86 for (int row = 0; row < rowCount; ++row)
87 {
88 for (int col = 0; col < colCount; ++col)
89 {
90 QModelIndex index = this->m_InternalModel->index(row, col);
91 if (col != 0)
92 {
93 stream << ",";
94 }
95 stream << SanatizeString(m_InternalModel->data(index, Qt::DisplayRole).toString().toStdString());
96 }
97 stream << std::endl;
98 }
99
100 return stream.str();
101}
102
103void QmitkFitPlotDataWidget::OnClipboardResultsButtonClicked() const
104{

Callers 2

OnExportClickedMethod · 0.95

Calls 7

SanatizeStringFunction · 0.85
columnCountMethod · 0.45
toStringMethod · 0.45
headerDataMethod · 0.45
rowCountMethod · 0.45
indexMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected