COPASI API  4.16.103
CQReportListItem.cpp
Go to the documentation of this file.
1 /* Begin CVS Header
2 $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQReportListItem.cpp,v $
3 $Revision: 1.9 $
4 $Name: $
5 $Author: shoops $
6 $Date: 2011/10/17 14:58:06 $
7 End CVS Header */
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #include <string>
19 
20 #include "copasi.h"
21 
22 #include "CQReportListItem.h"
23 #include "qtUtilities.h"
26 
27 CQReportListItem::CQReportListItem(const std::string & cn):
28  QListWidgetItem(),
29  mCN(cn)
30 {
31  refreshText();
32 }
33 
35  QListWidgetItem(),
36  mCN("")
37 {
38  if (pObject)
39  {
40  setText(FROM_UTF8(pObject->getObjectDisplayName()));
41  mCN = pObject->getCN();
42  }
43  else
44  {
45  setText(QString("Not found"));
46  mCN = CCopasiStaticString("NotFound").getCN();
47  }
48 }
49 
51 
52 const CCopasiObjectName & CQReportListItem::getCN() const {return mCN;};
53 
55 {
56  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
58  assert(pDataModel != NULL);
59  const CCopasiObject * pObject = pDataModel->getDataObject(mCN);
60 
61  if (pObject)
62  setText(FROM_UTF8(pObject->getObjectDisplayName()));
63  else
64  setText(QString("Not found: ") + FROM_UTF8(mCN));
65 }
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
virtual CCopasiObjectName getCN() const
const CCopasiObjectName & getCN() const
CRegisteredObjectName mCN
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CQReportListItem(const std::string &cn)