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

#include <CQCopasiApplication.h>

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

Public Member Functions

 CQCopasiApplication (int &argc, char **argv)
 
virtual bool event (QEvent *pEvent)
 
void setMainWindow (CopasiUI3Window *pMainWindow)
 
virtual ~CQCopasiApplication ()
 

Private Attributes

QString mFile
 
CopasiUI3WindowmpMainWindow
 
bool mStarting
 

Detailed Description

Definition at line 14 of file CQCopasiApplication.h.

Constructor & Destructor Documentation

CQCopasiApplication::CQCopasiApplication ( int &  argc,
char **  argv 
)

Definition at line 39 of file CQCopasiApplication.cpp.

39  :
40  QApplication(argc, argv),
41  mpMainWindow(NULL),
42  mFile(),
43  mStarting(true)
44 {
45 #if WIN32
46 
47  if (IsWindows8())
48  setStyle(new QWindowsVistaStyle);
49 
50 #endif
51 
52 // Alter styles using Qt's CSS-like mechanism
53  QString globalStyleSheet =
54  "QLineEdit[readOnly=\"true\"] {\n" // When readOnly
55  " color: gray;\n" // make text gray and
56  " border: false;\n" // remove box border.
57  "}\n"; //can add future items after this (move semicolon down)
58 
59  qApp->setStyleSheet(globalStyleSheet);
60 }
CopasiUI3Window * mpMainWindow
CQCopasiApplication::~CQCopasiApplication ( )
virtual

Definition at line 62 of file CQCopasiApplication.cpp.

63 {
64 }

Member Function Documentation

bool CQCopasiApplication::event ( QEvent *  pEvent)
virtual

Definition at line 67 of file CQCopasiApplication.cpp.

References mFile, mpMainWindow, mStarting, and CopasiUI3Window::slotFileOpen().

68 {
69  switch (pEvent->type())
70  {
71  case QEvent::FileOpen:
72 
73  if (mStarting)
74  {
75  mFile = static_cast<QFileOpenEvent *>(pEvent)->file();
76  }
77  else
78  {
79  // need to take the new file, otherwise whenever the application
80  // is open we will re-open the first file that was supposed to be
81  // opened.
82  mFile = static_cast<QFileOpenEvent *>(pEvent)->file();
84  }
85 
86  pEvent->accept();
87  return true;
88 
89  break;
90 
91  default:
92  break;
93  }
94 
95  return QApplication::event(pEvent);
96 }
void slotFileOpen(QString file=QString::null)
CopasiUI3Window * mpMainWindow
void CQCopasiApplication::setMainWindow ( CopasiUI3Window pMainWindow)

Definition at line 98 of file CQCopasiApplication.cpp.

References mFile, mpMainWindow, mStarting, and CopasiUI3Window::openInitialDocument().

Referenced by main().

99 {
100  mpMainWindow = pMainWindow;
101 
102  processEvents();
103 
105  mStarting = false;
106 }
void openInitialDocument(const QString &file)
CopasiUI3Window * mpMainWindow

Member Data Documentation

QString CQCopasiApplication::mFile
private

Definition at line 34 of file CQCopasiApplication.h.

Referenced by event(), and setMainWindow().

CopasiUI3Window* CQCopasiApplication::mpMainWindow
private

Definition at line 32 of file CQCopasiApplication.h.

Referenced by event(), and setMainWindow().

bool CQCopasiApplication::mStarting
private

Definition at line 36 of file CQCopasiApplication.h.

Referenced by event(), and setMainWindow().


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