Hi, I'm using the QGLWidget to display some data that I'm trying to plot. Each graph has its own Y axis and they all share an X axis (also QGLWidgets) When I try to update my scales to match the data, my program locks up and starts running at 99% of the CPU. I have a signal/slot connection to pass the new min and max for the scale. It's watching a realtime data stream, and sampling at 20ms intervals, and redrawing the screen at 200ms intervals. When I redraw the screen, I want the scales to adjust to the new right bound of the graph. I have the following code:
// shifts the shared X axis
// This is a slot
void GLScaleWidget::shiftX(const double &amt){
this->min = amt;
this->max = amt+30; //(assume 30s of data for now)
this->makeCurrent();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glTranslated(amt, 0, 0);
this->updateGL();
}
// shifts the shared X axis
// This is a slot
void GLScaleWidget::shiftX(const double &amt){
this->min = amt;
this->max = amt+30; //(assume 30s of data for now)
this->makeCurrent();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glTranslated(amt, 0, 0);
this->updateGL();
}
To copy to clipboard, switch view to plain text mode
and the problem that I'm getting is that as soon as it starts to do any shifting on the scale, everything else dies too. (It works fine if i dont shift the scale) gl Calls stop functioning correctly, and everything goes black in the window.
Any help with this would be greatly appreciated.
Thanks!!!
Bookmarks