Converts the content of a QmitkImageStatisticsTreeModel to a delimited string.
More...
#include <QmitkStatisticsModelToStringConverter.h>
Converts the content of a QmitkImageStatisticsTreeModel to a delimited string.
Iterates over all cells of a QmitkImageStatisticsTreeModel and produces a formatted string suitable for clipboard export or file output. The iteration traverses the tree hierarchy recursively, prepending parent labels with " >> " separators to leaf rows. Row and column delimiters are configurable (defaults: newline and comma). Header data (column captions) can optionally be included.
- See also
- QmitkImageStatisticsTreeModel
-
QmitkImageStatisticsWidget
Definition at line 31 of file QmitkStatisticsModelToStringConverter.h.
◆ QmitkStatisticsModelToStringConverter()
| QmitkStatisticsModelToStringConverter::QmitkStatisticsModelToStringConverter |
( |
| ) |
|
Default constructor. Initializes delimiters to newline and comma.
◆ GetString()
| QString QmitkStatisticsModelToStringConverter::GetString |
( |
| ) |
const |
Converts the model content to a formatted string.
- Returns
- The string representation of all statistics data.
- Exceptions
-
◆ SetColumnDelimiter()
| void QmitkStatisticsModelToStringConverter::SetColumnDelimiter |
( |
QChar |
columnDelimiter | ) |
|
Sets the delimiter used to separate columns.
- Parameters
-
| [in] | columnDelimiter | The column delimiter character (default: ','). |
◆ SetIncludeHeaderData()
| void QmitkStatisticsModelToStringConverter::SetIncludeHeaderData |
( |
bool |
includeHeaderData | ) |
|
Sets whether column header data should be included in the output.
- Parameters
-
| [in] | includeHeaderData | True to include headers; false to omit them. |
◆ SetModel()
Sets the statistics tree model to convert.
- Parameters
-
| [in] | model | Pointer to the tree model. Must not be nullptr when GetString() is called. |
◆ SetRootIndex()
| void QmitkStatisticsModelToStringConverter::SetRootIndex |
( |
QModelIndex |
rootIndex | ) |
|
Sets the root index from which to start the iteration.
- Parameters
-
| [in] | rootIndex | The root model index. Use an invalid QModelIndex for the model root. |
◆ SetRowDelimiter()
| void QmitkStatisticsModelToStringConverter::SetRowDelimiter |
( |
QChar |
rowDelimiter | ) |
|
Sets the delimiter used to separate rows.
- Parameters
-
| [in] | rowDelimiter | The row delimiter character (default: '\n'). |
The documentation for this class was generated from the following file: