MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fomTreeAndTableWidget.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #include "rtiMsConfig.h"
11 #include <QWidget>
12 #include <QModelIndex>
13 #include <vector>
14 #include <set>
15 
18 
19 class QVBoxLayout;
20 class QHBoxLayout;
21 class QTreeView;
22 class QAbstractItemModel;
23 class QLabel;
24 class QSignalMapper;
25 class QMenu;
26 class QAction;
27 class QString;
28 class QSplitter;
29 class QFile;
30 class QToolBar;
31 class QTextStream;
32 class DtGraphDialog;
33 class QStandardItem;
38 {
39  Q_OBJECT
40 
41 public:
42 
44  DtFomTreeAndTableWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
45 
47  virtual ~DtFomTreeAndTableWidget();
48 
51  typedef std::pair<unsigned, QModelIndex> DtTreeAndModelIndex;
52 
54  virtual QSize sizeHint() const;
55 
57  {
58  // Indicates the row header should be used as the name
60  // Indicates the first column should be used as the name
62  // Indicates that rows are unnamed
64  };
65 
69  unsigned addTree(const QString& name, QAbstractItemModel* model,
70  DtRowNameLoc rowNameLoc, bool decorateRoot, bool hideHeader, bool alternateRowColor);
71  void addTreeAndTable(const QString& treeName, QAbstractItemModel* treeModel,
72  DtRowNameLoc treeRowNameLoc,
73  const QString& TableName, QAbstractItemModel* tableModel,
74  DtRowNameLoc tableRowNameLoc);
77  void initComplete();
78 
79 
80 
81 
82 
85  void saveGuiConfiguration(QFile& configFile);
86 
89  void loadGuiConfiguration(QFile& configFile);
90 
92  void setFederateId(const QString& federateId) { myFederateId = federateId; }
93 
94  void updateTreeLabel(const QString& name);
95 
96  const QModelIndex getCurrentSelection() const;
97 
98  void expandTree() const;
99 
100  void collapseItem(QStandardItem * item);
101 
102  void setSelectionBehaviorRow();
103 
104  void refresh() const;
105 protected:
106 
108  void initTrees();
109 
111  void connectSignals();
112 
114  void getRowAndColNames(DtTreeAndModelIndex modelIndex, QString& rowName,
115  QString& colName);
116 
117 
119  {
121  CsvTableFormat
122  };
123 
126  void writeTreeToStream(const QTreeView* tree, QTextStream& fileStrm,
127  TableFileFormat format);
128 
129  signals:
130  void treeItemSelected(const QModelIndex& index);
131 
132  public slots:
133 
134 
137  void processItemSelection(const QModelIndex& index);
138 
140  void processItemSelectionChange();
141 
143  void processCurrentChanged(const QModelIndex&, const QModelIndex&);
144 
145 
147  void updateSortingEnable();
148 
149 private:
150 
153 
156 protected:
157 
159  QSplitter* mySplitter;
160 
162  std::vector<QVBoxLayout*> myTreeLayouts;
163 
165  std::vector<QLabel*> myTreeLabels;
166 
168  std::vector<QHBoxLayout*> myTreeLabelLayouts;
169 
171  std::vector<QTreeView*> myTreeViews;
172 
173  unsigned int myTreeIndex;
174  unsigned int myTableIndex;
175 
177  std::vector<DtRowNameLoc> myTreeRowNameLocs;
178 
181  std::vector<std::map<unsigned, QString> > myTreeValGraphableCols;
182 
185  std::vector<std::map<unsigned, QString> > myTreeRateGraphableCols;
186 
187 
190 
192  QString myFederateId;
193 
196  static const QString theTreeBreakText;
197 };

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)