COPASI API  4.16.103
CQBaseDataModel.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQBaseDataModel.h,v $
3 // $Revision: 1.10 $
4 // $Name: $
5 // $Author: bergmann $
6 // $Date: 2012/04/10 15:19:37 $
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 CQBaseDataModel_H
20 #define CQBaseDataModel_H
21 
22 #include <QtCore/QAbstractTableModel>
23 
24 #include "copasi/UI/listviews.h"
25 
26 #define COL_ROW_NUMBER 0
27 
28 class CQBaseDataModel : public QAbstractTableModel
29 {
30  Q_OBJECT
31 
32 public:
33  CQBaseDataModel(QObject *parent = 0);
34  virtual QVariant data(const QModelIndex &index, int role) const = 0;
35  virtual QVariant headerData(int section, Qt::Orientation orientation,
36  int role = Qt::DisplayRole) const = 0;
37  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
38  virtual bool setData(const QModelIndex &index, const QVariant &value,
39  int role = Qt::EditRole) = 0;
40  bool insertRow();
41  bool removeRow(int position);
42  virtual bool clear();
43  virtual bool isDefaultRow(const QModelIndex& i) const;
44  QString createNewName(const QString name, const int nameCol);
45 
46 protected:
47  virtual bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) = 0;
48  virtual bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) = 0;
49 
50 signals:
51  void notifyGUI(ListViews::ObjectType objectType, ListViews::Action action, const std::string & key = "");
52 };
53 
54 #endif //CQBaseDataModel_H
objectType
void notifyGUI(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
virtual bool clear()
virtual bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())=0
bool removeRow(int position)
QString createNewName(const QString name, const int nameCol)
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)=0
virtual Qt::ItemFlags flags(const QModelIndex &index) const
CQBaseDataModel(QObject *parent=0)
virtual QVariant data(const QModelIndex &index, int role) const =0
virtual bool isDefaultRow(const QModelIndex &i) const
virtual bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex())=0
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const =0