QScrollArea Timer Hack

This commit is contained in:
Mark Watkins 2011-08-07 22:33:00 +10:00
parent 9dc01b2eaa
commit ff815b45ad
3 changed files with 23 additions and 5 deletions

View File

@ -692,8 +692,16 @@ bool ResmedLoader::LoadPLD(Session *sess,EDFParser &edf)
a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
//a->setMax(1);
//a->setMin(0);
} else if ((es.label=="Therapy Pres") || (es.label=="Insp Pres")) {
} else if (es.label=="Therapy Pres") {
code=CPAP_IPAP; //TherapyPressure;
sess->settings[CPAP_Mode]=MODE_APAP;
//EventList *a=new EventList(code,EVL_Waveform,es.gain,es.offset,es.physical_minimum,es.physical_maximum,rate);
//sess->eventlist[code].push_back(a);
//a->AddWaveform(edf.startdate,es.data,recs,duration);
a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
} else if (es.label=="Insp Pres") {
code=CPAP_IPAP; //TherapyPressure;
sess->settings[CPAP_Mode]=MODE_BIPAP;
//EventList *a=new EventList(code,EVL_Waveform,es.gain,es.offset,es.physical_minimum,es.physical_maximum,rate);
//sess->eventlist[code].push_back(a);
//a->AddWaveform(edf.startdate,es.data,recs,duration);

View File

@ -32,16 +32,24 @@ const int default_height=150;
MyScrollArea::MyScrollArea(QWidget *parent, Daily * daily)
:QScrollArea(parent),m_daily(daily)
{
timer=new QTimer(parent);
}
MyScrollArea::~MyScrollArea()
{
delete timer;
}
void MyScrollArea::scrollContentsBy(int dx, int dy)
{
QScrollArea::scrollContentsBy(dx,dy);
#ifdef Q_WS_MAC
m_daily->RedrawGraphs();
#endif
//#ifdef Q_WS_MAC || Q_WS_WIN
if (timer->isActive()) timer->stop();
timer->setInterval(100);
timer->setSingleShot(true);
connect(timer,SIGNAL(timeout()),SLOT(RedrawGraphs()));
timer->start();
//m_daily->RedrawGraphs();
//#endif
}
Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)

View File

@ -35,6 +35,7 @@ public:
protected:
virtual void scrollContentsBy(int dx, int dy);
Daily *m_daily;
QTimer *timer;
};
class MainWindow;
@ -46,10 +47,11 @@ public:
explicit Daily(QWidget *parent,QGLWidget *shared,MainWindow *mw);
~Daily();
void ReloadGraphs();
void RedrawGraphs();
void ResetGraphLayout();
QGLWidget *SharedWidget() { return SF; }
public slots:
void RedrawGraphs();
private slots:
void on_calendar_currentPageChanged(int year, int month);