COPASI API  4.16.103
Public Member Functions | Private Slots | List of all members
FontChooser Class Reference

#include <FontChooser.h>

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

Public Member Functions

 FontChooser (QWidget *parent=0, bool modal=false, Qt::WindowFlags fl=0)
 

Private Slots

void cancel ()
 
void changeFontSize ()
 

Detailed Description

Definition at line 15 of file FontChooser.h.

Constructor & Destructor Documentation

FontChooser::FontChooser ( QWidget *  parent = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 20 of file FontChooser.cpp.

References C_INT32, CQLayoutMainWindow::getFontSize(), and CQGLNetworkPainter::getFontSize().

21  : QDialog(parent, fl)
22 {
23  setupUi(this);
24  this->setModal(modal);
25  QString className = QString(parentWidget()->metaObject()->className());
26 
27  if (className == "CQLayoutMainWindow")
28  {
29  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget());
30  assert(tmp);
31 
32  if (tmp)
33  {
34  C_INT32 currentFontSize = (C_INT32)(tmp->getFontSize());
35  spinBox1->setValue(currentFontSize);
36  }
37  }
38  else if (className == "CQGLNetworkPainter")
39  {
40  CQGLNetworkPainter * tmp = dynamic_cast<CQGLNetworkPainter *>(parentWidget());
41  assert(tmp);
42 
43  if (tmp)
44  {
45  C_INT32 currentFontSize = (C_INT32)(tmp->getFontSize());
46  spinBox1->setValue(currentFontSize);
47  }
48  }
49 }
#define C_INT32
Definition: copasi.h:90
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)

Member Function Documentation

void FontChooser::cancel ( )
privateslot

Definition at line 74 of file FontChooser.cpp.

75 {
76  close();
77 }
void FontChooser::changeFontSize ( )
privateslot

Definition at line 51 of file FontChooser.cpp.

References C_INT32, CQLayoutMainWindow::setFontSizeForLabels(), and CQGLNetworkPainter::setFontSizeForLabels().

52 {
53  QString className = QString(parentWidget()->metaObject()->className());
54  C_INT32 val = spinBox1->value();
55 
56  if (className == "CQLayoutMainWindow")
57  {
58  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget());
59  assert(tmp);
60 
61  if (tmp)
62  tmp->setFontSizeForLabels(val);
63  }
64  else if (className == "CQGLNetworkPainter") // check for another possible parent window
65  {
66  CQGLNetworkPainter * tmp = dynamic_cast<CQGLNetworkPainter *>(parentWidget());
67  assert(tmp);
68 
69  if (tmp)
70  tmp->setFontSizeForLabels((unsigned int) val);
71  }
72 }
void setFontSizeForLabels(C_INT32 size)
#define C_INT32
Definition: copasi.h:90
void setFontSizeForLabels(unsigned int fs)

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