Thanks again Uwe.
I have rewrote the code in the renderer as following :
void QwtPlotRenderer::renderTo (QwtPlot* plot, QPrinter& printer)
{
int w = printer.width ( ), h = printer.height ( );
int cw = plot->canvas ( )->width ( ), ch = plot->canvas ( )->height ( );
QRectF rect (0, 0, w, h);
double caspect = cw / ch;
if (caspect >= 1.) rect.setHeight (rect.width ( ) / caspect);
else rect.setWidth (rect.height ( ) * caspect);
QPainter p (&printer);
render (plot, &p, rect);
}
It works, but not perfectly, the aspect ratio on the sheet is about 0.95, and I have to multiply height with a coef in order to kept my ratio to 1.
Charles





Reply With Quote

Bookmarks