Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkStatisticsModelToStringConverter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef QmitkTableModelToQString_H__INCLUDED
13 #define QmitkTableModelToQString_H__INCLUDED
14 
16 #include <QAbstractItemModel>
17 
31 {
32 public:
34 
35  void SetTableModel(QAbstractItemModel *model);
36  void SetRootIndex(QModelIndex rootIndex);
41  QString GetString() const;
42  void SetRowDelimiter(QChar lineDelimiter);
43  void SetColumnDelimiter(QChar columnDelimiter);
47  void SetIncludeHeaderData(bool includeHeaderData);
48 
49 private:
54  QString Iterate(const QModelIndex &index,
55  const QAbstractItemModel *model,
56  int depth = 0) const;
57 
58  QAbstractItemModel *m_statisticsModel = nullptr;
59  QModelIndex m_rootIndex;
60  QChar m_lineDelimiter = '\n';
61  bool m_includeHeaderData = false;
62  QString m_columnDelimiterWithSpace = ", ";
63 };
64 #endif // QmitkTableModelToQString_H__INCLUDED
#define MITKIMAGESTATISTICSUI_EXPORT
Converts the content of the statistics model to a string.