COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CQReportListItem Class Reference

#include <CQReportListItem.h>

Inheritance diagram for CQReportListItem:
Inheritance graph
[legend]
Collaboration diagram for CQReportListItem:
Collaboration graph
[legend]

Public Member Functions

 CQReportListItem (const std::string &cn)
 
 CQReportListItem (const CCopasiObject *pObject)
 
const CCopasiObjectNamegetCN () const
 
void refreshText ()
 
 ~CQReportListItem ()
 

Private Attributes

CRegisteredObjectName mCN
 

Detailed Description

Definition at line 31 of file CQReportListItem.h.

Constructor & Destructor Documentation

CQReportListItem::CQReportListItem ( const std::string &  cn)

Definition at line 27 of file CQReportListItem.cpp.

References refreshText().

27  :
28  QListWidgetItem(),
29  mCN(cn)
30 {
31  refreshText();
32 }
CRegisteredObjectName mCN
CQReportListItem::CQReportListItem ( const CCopasiObject pObject)

Definition at line 34 of file CQReportListItem.cpp.

References FROM_UTF8, CCopasiObject::getCN(), CCopasiObject::getObjectDisplayName(), and mCN.

34  :
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 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
virtual CCopasiObjectName getCN() const
CRegisteredObjectName mCN
CQReportListItem::~CQReportListItem ( )

Definition at line 50 of file CQReportListItem.cpp.

50 {}

Member Function Documentation

const CCopasiObjectName & CQReportListItem::getCN ( ) const

Definition at line 52 of file CQReportListItem.cpp.

References mCN.

52 {return mCN;};
CRegisteredObjectName mCN
void CQReportListItem::refreshText ( )

Definition at line 54 of file CQReportListItem.cpp.

References FROM_UTF8, CCopasiRootContainer::getDatamodelList(), CCopasiDataModel::getDataObject(), CCopasiObject::getObjectDisplayName(), and mCN.

Referenced by CQReportListItem().

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
CRegisteredObjectName mCN
static CCopasiVector< CCopasiDataModel > * getDatamodelList()

Member Data Documentation

CRegisteredObjectName CQReportListItem::mCN
private

Definition at line 47 of file CQReportListItem.h.

Referenced by CQReportListItem(), getCN(), and refreshText().


The documentation for this class was generated from the following files: