MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fomTreeAndTableWidget.h
Go to the documentation of this file.
1 #ifndef fomTreeAndTableWidget_h__
2 #define fomTreeAndTableWidget_h__
3 
4 /*********************************************************************
5 ** Copyright (c) 2012 MaK Technologies, Inc.
6 ** All rights reserved.
7 *********************************************************************/
8 
9 
10 
11 #include "rtiMsConfig.h"
12 #include <QtGui/QWidget>
13 #include <QModelIndex>
14 #include <vector>
15 #include <set>
16 
19 
20 class QVBoxLayout;
21 class QHBoxLayout;
22 class QTreeView;
23 class QAbstractItemModel;
24 class QLabel;
25 class QSignalMapper;
26 class QMenu;
27 class QAction;
28 class QString;
29 class QSplitter;
30 class QFile;
31 class QToolBar;
32 class QTextStream;
33 class DtGraphDialog;
34 class QStandardItem;
39 {
40  Q_OBJECT
41 
42 public:
43 
45  DtFomTreeAndTableWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
46 
48  virtual ~DtFomTreeAndTableWidget();
49 
52  typedef std::pair<unsigned, QModelIndex> DtTreeAndModelIndex;
53 
55  virtual QSize sizeHint() const;
56 
58  {
59  // Indicates the row header should be used as the name
61  // Indicates the first column should be used as the name
63  // Indicates that rows are unnamed
65  };
66 
70  unsigned addTree(const QString& name, QAbstractItemModel* model,
71  DtRowNameLoc rowNameLoc, bool decorateRoot, bool hideHeader, bool alternateRowColor);
72  void addTreeAndTable(const QString& treeName, QAbstractItemModel* treeModel,
73  DtRowNameLoc treeRowNameLoc,
74  const QString& TableName, QAbstractItemModel* tableModel,
75  DtRowNameLoc tableRowNameLoc);
78  void initComplete();
79 
80 
81 
82 
83 
86  void saveGuiConfiguration(QFile& configFile);
87 
90  void loadGuiConfiguration(QFile& configFile);
91 
93  void setFederateId(const QString& federateId) { myFederateId = federateId; }
94 
95  void updateTreeLabel(const QString& name);
96 
97  const QModelIndex getCurrentSelection() const;
98 
99  void expandTree() const;
100 
101  void collapseItem(QStandardItem * item);
102 
103  void setSelectionBehaviorRow();
104 
105  void refresh() const;
106 protected:
107 
109  void initTrees();
110 
112  void connectSignals();
113 
115  void getRowAndColNames(DtTreeAndModelIndex modelIndex, QString& rowName,
116  QString& colName);
117 
118 
120  {
122  CsvTableFormat
123  };
124 
127  void writeTreeToStream(const QTreeView* tree, QTextStream& fileStrm,
128  TableFileFormat format);
129 
130  signals:
131  void treeItemSelected(const QModelIndex& index);
132 
133  public slots:
134 
135 
138  void processItemSelection(const QModelIndex& index);
139 
141  void processItemSelectionChange();
142 
144  void processCurrentChanged(const QModelIndex&, const QModelIndex&);
145 
146 
148  void updateSortingEnable();
149 
150 private:
151 
154 
157 protected:
158 
160  QSplitter* mySplitter;
161 
163  std::vector<QVBoxLayout*> myTreeLayouts;
164 
166  std::vector<QLabel*> myTreeLabels;
167 
169  std::vector<QHBoxLayout*> myTreeLabelLayouts;
170 
172  std::vector<QTreeView*> myTreeViews;
173 
174  unsigned int myTreeIndex;
175  unsigned int myTableIndex;
176 
178  std::vector<DtRowNameLoc> myTreeRowNameLocs;
179 
182  std::vector<std::map<unsigned, QString> > myTreeValGraphableCols;
183 
186  std::vector<std::map<unsigned, QString> > myTreeRateGraphableCols;
187 
188 
191 
193  QString myFederateId;
194 
197  static const QString theTreeBreakText;
198 };
199 
200 
201 #endif // fomTreeAndTableWidget_h__

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)