-
1 Attachment(s)
Updating plots
I set up a grid of timeseries QwtPlots like this:
for (int i=0; i<nGraphs; i++) {
mdiArea->addSubWindow(pGraph[i]);
pGraph[i]->show();
}
As the program executes, at each time step the line plot is redrawn with the incremented number of data points. This all works fine. The only problem is that usually (but not always) the y axis title and/or y axis labels are truncated, as in the attached pic.
Attachment 12980
I'd like to know if there is a command to update or resize (whatever the right term is) the plots so that the axis title (if present) and the axis labels are visible.
Thanks
Gib
-
Re: Updating plots
QwtPlot::updateLayout recalculates the geometries of the components of a plot.
But well behaving children indicate relevant changes concerning their sizeHint by posting a QEvent::LayoutRequest to the parent, what leads in case of QwtPlot to calling updateLayout. Could you try to find out, why this is not happening in your situation ?
Uwe
-
Re: Updating plots
Hi Uwe, thanks for the quick response.
The only two factors I can think of are first that I am a primitive C++ programmer, and second that in many plots (I have a grid with 20 plots in 4 rows) the range of the y axis is constantly changing, sometimes increasing a lot. I have added a call to updateLayout after redraw, and all looks good now.
I'm not sure how I'd go about tracking down the cause of bad child behaviour. Maybe you can make a suggestion. I am busy preparing for a presentation in a couple of days, so I will not have time to do much immediately.
Gib