COPASI API  4.16.103
CQGlobalQuantityDM.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQGlobalQuantityDM.h,v $
3 // $Revision: 1.2 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:37:59 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 #ifndef CQGlobalQuantityDM_H
20 #define CQGlobalQuantityDM_H
21 
22 #include "model/CModel.h"
23 #include "CQBaseDataModel.h"
24 
25 #define COL_NAME_GQ 1
26 #define COL_TYPE_GQ 2
27 #define COL_INITIAL_GQ 3
28 #define COL_TRANSIENT_GQ 4
29 #define COL_RATE_GQ 5
30 #define COL_IEXPRESSION_GQ 6
31 #define COL_EXPRESSION_GQ 7
32 #define TOTAL_COLS_GQ 8
33 
35 {
36  Q_OBJECT
37 
38 public:
39  CQGlobalQuantityDM(QObject *parent = 0);
40  const QStringList& getTypes();
41  const std::vector< unsigned C_INT32 >& getItemToType();
42  int virtual rowCount(const QModelIndex &parent = QModelIndex()) const;
43  int virtual columnCount(const QModelIndex &parent = QModelIndex()) const;
44  Qt::ItemFlags flags(const QModelIndex &index) const;
45  QVariant data(const QModelIndex &index, int role) const;
46  QVariant headerData(int section, Qt::Orientation orientation,
47  int role = Qt::DisplayRole) const;
48  bool setData(const QModelIndex &index, const QVariant &value,
49  int role = Qt::EditRole);
50  bool removeRows(QModelIndexList rows, const QModelIndex &index = QModelIndex());
51 
52 protected:
53  QStringList mTypes;
54  /**
55  * A vector mapping the item index to a model valu type
56  */
57  std::vector< unsigned C_INT32 > mItemToType;
58  bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
59  bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
60 };
61 
62 #endif //CQGlobalQuantityDM_H
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
const QStringList & getTypes()
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
QVariant data(const QModelIndex &index, int role) const
CQGlobalQuantityDM(QObject *parent=0)
Qt::ItemFlags flags(const QModelIndex &index) const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
bool removeRows(QModelIndexList rows, const QModelIndex &index=QModelIndex())
std::vector< unsigned C_INT32 > mItemToType
const std::vector< unsigned C_INT32 > & getItemToType()
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())