diff --git a/Graphs/graphwindow.cpp b/Graphs/graphwindow.cpp index 9c634b31..71ff09c7 100644 --- a/Graphs/graphwindow.cpp +++ b/Graphs/graphwindow.cpp @@ -8,6 +8,11 @@ #include #include #include + +#ifdef __APPLE__ +#include +#endif + #include "SleepLib/profiles.h" #include "graphwindow.h" #include "gTitle.h" @@ -806,8 +811,15 @@ void gGraphWindow::initializeGL() m_scrX=width(); m_scrY=height(); + /*QGLFormat glFormat(QGL::SampleBuffers); + glFormat.setAlpha(true); + glFormat.setDirectRendering(true); + glFormat.setSwapInterval(1); + setFormat(glFormat);*/ + } +bool first_draw_event=true; void gGraphWindow::resizeGL(int w, int h) { m_scrX=w; @@ -868,11 +880,16 @@ void gGraphWindow::Render(int w, int h) void gGraphWindow::paintGL() { - if (m_scrX<=0) m_scrX=width(); if (m_scrY<=0) m_scrY=height(); if (m_scrX<=0) return; if (m_scrY<=0) return; +#ifdef __APPLE__ + AGLContext aglContext; + aglContext=aglGetCurrentContext(); + GLint swapInt=1; + aglSetInteger(aglContext, AGL_SWAP_INTERVAL, &swapInt); +#endif //glDisable(GL_DEPTH_TEST); Render(m_scrX,m_scrY); diff --git a/daily.cpp b/daily.cpp index 9c71fb0b..c7378a0f 100644 --- a/daily.cpp +++ b/daily.cpp @@ -8,6 +8,7 @@ #include "ui_daily.h" #include +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include "SleepLib/session.h" #include "Graphs/graphdata_custom.h" @@ -62,7 +64,6 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw) layout->addWidget(GraphView,1); layout->addWidget(scrollbar,0); - SF=new gGraph(GraphView,"Event Flags",180); FRW=new gGraph(GraphView,"Flow Rate",180); MP=new gGraph(GraphView,"Mask Pressure",180); @@ -160,15 +161,24 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw) /* scrollArea=new MyScrollArea(ui->graphMainArea,this); +======= + scrollArea=new MyScrollArea(ui->graphMainArea,this); + QPalette p; + p.setColor(QPalette::Window,Qt::white); + scrollArea->setPalette(p); + scrollArea->setBackgroundRole(QPalette::Window); +>>>>>>> 70c348c1e196c10bbd34b1ce73bce9dda7fdbd29 ui->graphLayout->addWidget(scrollArea,1); ui->graphLayout->setSpacing(0); ui->graphLayout->setMargin(0); ui->graphLayout->setContentsMargins(0,0,0,0); scrollArea->setWidgetResizable(true); - scrollArea->setAutoFillBackground(false); + scrollArea->setAutoFillBackground(true); GraphLayout=new QWidget(scrollArea); - GraphLayout->setAutoFillBackground(false); + GraphLayout->setAutoFillBackground(true); + GraphLayout->setPalette(p); + GraphLayout->setBackgroundRole(QPalette::Window); scrollArea->setWidget(GraphLayout); splitter=new QVBoxLayout(GraphLayout); @@ -1123,16 +1133,6 @@ void Daily::on_treeWidget_itemSelectionChanged() double st=(d.addSecs(-120)).toMSecsSinceEpoch(); double et=(d.addSecs(120)).toMSecsSinceEpoch(); GraphView->SetXBounds(st,et); - /*FRW->SetXBounds(st,et); - MP->SetXBounds(st,et); - SF->SetXBounds(st,et); - PRD->SetXBounds(st,et); - LEAK->SetXBounds(st,et); - SNORE->SetXBounds(st,et); - MV->SetXBounds(st,et); - TV->SetXBounds(st,et); - RR->SetXBounds(st,et); - FLG->SetXBounds(st,et); */ } } diff --git a/mainwindow.ui b/mainwindow.ui index 0038b4a1..f56702c7 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -73,6 +73,9 @@ 16777215 + + true + QTabWidget::North