COPASI API  4.16.103
CQCompartmentDM.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQCompartmentDM.h,v $
3 // $Revision: 1.8 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2012/03/15 17:06:48 $
7 // End CVS Header
8 
9 // Copyright (C) 2012 - 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 CQCompartmentDM_H
20 #define CQCompartmentDM_H
21 
22 #include <vector>
23 
25 
26 #define COL_NAME_COMPARTMENTS 1
27 #define COL_TYPE_COMPARTMENTS 2
28 #define COL_IVOLUME 3
29 #define COL_VOLUME 4
30 #define COL_RATE_COMPARTMENTS 5
31 #define COL_IEXPRESSION_COMPARTMENTS 6
32 #define COL_EXPRESSION_COMPARTMENTS 7
33 #define TOTAL_COLS_COMPARTMENTS 8
34 
36 {
37  Q_OBJECT
38 
39 public:
40  CQCompartmentDM(QObject *parent = 0);
41  const QStringList& getTypes();
42  const std::vector< unsigned C_INT32 >& getItemToType();
43  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
44  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
45  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
46  virtual QVariant data(const QModelIndex &index, int role) const;
47  virtual QVariant headerData(int section, Qt::Orientation orientation,
48  int role = Qt::DisplayRole) const;
49  virtual bool setData(const QModelIndex &index, const QVariant &value,
50  int role = Qt::EditRole);
51  bool removeRows(QModelIndexList rows, const QModelIndex &index = QModelIndex());
52 
53 protected:
54  QStringList mTypes;
55  /**
56  * A vector mapping the item index to a model valu type
57  */
58  std::vector< unsigned C_INT32 > mItemToType;
59  bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
60  bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
61 };
62 
63 #endif //CQCompartmentDM_H
virtual Qt::ItemFlags flags(const QModelIndex &index) const
bool removeRows(QModelIndexList rows, const QModelIndex &index=QModelIndex())
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())
std::vector< unsigned C_INT32 > mItemToType
virtual QVariant data(const QModelIndex &index, int role) const
const std::vector< unsigned C_INT32 > & getItemToType()
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
const QStringList & getTypes()
CQCompartmentDM(QObject *parent=0)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
QStringList mTypes
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const