Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkStatisticsModelToStringConverter Class Reference

Converts the content of a QmitkImageStatisticsTreeModel to a delimited string. More...

#include <QmitkStatisticsModelToStringConverter.h>

Public Member Functions

 QmitkStatisticsModelToStringConverter ()
 Default constructor. Initializes delimiters to newline and comma. More...
 
void SetModel (QmitkImageStatisticsTreeModel *model)
 Sets the statistics tree model to convert. More...
 
void SetRootIndex (QModelIndex rootIndex)
 Sets the root index from which to start the iteration. More...
 
QString GetString () const
 Converts the model content to a formatted string. More...
 
void SetRowDelimiter (QChar rowDelimiter)
 Sets the delimiter used to separate rows. More...
 
void SetColumnDelimiter (QChar columnDelimiter)
 Sets the delimiter used to separate columns. More...
 
void SetIncludeHeaderData (bool includeHeaderData)
 Sets whether column header data should be included in the output. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ QmitkStatisticsModelToStringConverter()

QmitkStatisticsModelToStringConverter::QmitkStatisticsModelToStringConverter ( )

Default constructor. Initializes delimiters to newline and comma.

Member Function Documentation

◆ GetString()

QString QmitkStatisticsModelToStringConverter::GetString ( ) const

Converts the model content to a formatted string.

Returns
The string representation of all statistics data.
Exceptions
mitk::Exceptionif the model is nullptr.

◆ SetColumnDelimiter()

void QmitkStatisticsModelToStringConverter::SetColumnDelimiter ( QChar  columnDelimiter)

Sets the delimiter used to separate columns.

Parameters
[in]columnDelimiterThe column delimiter character (default: ',').

◆ SetIncludeHeaderData()

void QmitkStatisticsModelToStringConverter::SetIncludeHeaderData ( bool  includeHeaderData)

Sets whether column header data should be included in the output.

Parameters
[in]includeHeaderDataTrue to include headers; false to omit them.

◆ SetModel()

void QmitkStatisticsModelToStringConverter::SetModel ( QmitkImageStatisticsTreeModel *  model)

Sets the statistics tree model to convert.

Parameters
[in]modelPointer 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]rootIndexThe 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]rowDelimiterThe row delimiter character (default: '\n').

The documentation for this class was generated from the following file: