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

#include <CQTSSATimeScaleWidget.h>

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

Public Slots

void changedInterval ()
 

Public Member Functions

void clearWidget ()
 
 CQTSSATimeScaleWidget (QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
 
void paintTimeScale (CVector< C_FLOAT64 > vector)
 
 ~CQTSSATimeScaleWidget ()
 

Private Attributes

PaintWidgetmpPaintWidget
 
QSlider * mpSlider
 
QVBoxLayout * mpVLayout
 

Detailed Description

Definition at line 42 of file CQTSSATimeScaleWidget.h.

Constructor & Destructor Documentation

CQTSSATimeScaleWidget::CQTSSATimeScaleWidget ( QWidget *  parent = 0,
const char *  name = 0,
Qt::WFlags  fl = 0 
)

Definition at line 24 of file CQTSSATimeScaleWidget.cpp.

References changedInterval(), mpPaintWidget, mpSlider, and mpVLayout.

25  : QWidget(parent, fl)
26 {
27  setObjectName(QString::fromUtf8(name));
28 
29  if (!name)
30  setObjectName("CQTSSATimeScaleWidget");
31 
32  mpVLayout = new QVBoxLayout(this);
33  mpPaintWidget = new PaintWidget(this, "PaintWidget");
34  mpPaintWidget->setMinimumHeight(200);
35  mpSlider = new QSlider(Qt::Horizontal, this);
36  mpSlider->setDisabled(true);
37 
38  mpVLayout->addWidget(mpPaintWidget);
39  mpVLayout->addWidget(mpSlider);
40 
41  mpPaintWidget->setStyleSheet(QString(mpPaintWidget->metaObject()->className()) + " {background-color:" + QColor(Qt::white).name() + ";}");
42  mpPaintWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
43  mpSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
44 
45  mpSlider->setToolTip("move Slider to set focus on prefered time scale"); // <- helpful
46  connect(mpSlider, SIGNAL(valueChanged(int)), this, SLOT(changedInterval()));
47 }
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CQTSSATimeScaleWidget::~CQTSSATimeScaleWidget ( )

Definition at line 52 of file CQTSSATimeScaleWidget.cpp.

53 {
54  // no need to delete child widgets, Qt does it all for us
55 }

Member Function Documentation

void CQTSSATimeScaleWidget::changedInterval ( )
slot

Definition at line 77 of file CQTSSATimeScaleWidget.cpp.

References mpPaintWidget, mpSlider, PaintWidget::mVector, PaintWidget::paintTimeScale(), and CVectorCore< CType >::size().

Referenced by CQTSSATimeScaleWidget().

78 {
79  if (mpPaintWidget->mVector.size() == 0)
80  return;
81 
83 }
size_t size() const
Definition: CVector.h:100
void paintTimeScale(int select)
CVector< C_FLOAT64 > mVector
void CQTSSATimeScaleWidget::clearWidget ( )

Definition at line 85 of file CQTSSATimeScaleWidget.cpp.

References PaintWidget::mClear, mpPaintWidget, and mpSlider.

86 {
87  mpPaintWidget->mClear = true;
88  mpPaintWidget->repaint();
89  mpSlider->setDisabled(true);
90 }
void CQTSSATimeScaleWidget::paintTimeScale ( CVector< C_FLOAT64 vector)

Definition at line 57 of file CQTSSATimeScaleWidget.cpp.

References PaintWidget::mClear, mpPaintWidget, mpSlider, PaintWidget::mVector, PaintWidget::paintTimeScale(), and CVectorCore< CType >::size().

58 {
59 
60  if (vector.size() > 0)
61  {
62  mpPaintWidget->mClear = false;
63  mpSlider->setDisabled(false);
64 
65  if (vector.size() != mpPaintWidget->mVector.size())
66  {
67  mpSlider->setRange(0, (int)(vector.size() - 1));
68  mpSlider->setValue(mpSlider->minimum());
69  }
70 
71  mpPaintWidget->mVector = vector;
73  mpPaintWidget->repaint();
74  }
75 }
size_t size() const
Definition: CVector.h:100
void paintTimeScale(int select)
CVector< C_FLOAT64 > mVector

Member Data Documentation

PaintWidget* CQTSSATimeScaleWidget::mpPaintWidget
private
QSlider* CQTSSATimeScaleWidget::mpSlider
private
QVBoxLayout* CQTSSATimeScaleWidget::mpVLayout
private

Definition at line 57 of file CQTSSATimeScaleWidget.h.

Referenced by CQTSSATimeScaleWidget().


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