giusepped
10th December 2008, 08:04
I copied the code from the bode example in my program.
No errors, anyway the result of the printing is wrong, because
1) the axis are not shown (the ticks are shown)
2) the content of the plot, not the box, is shifted down.
I put the code for completeness.
void OptimumPlot::printOut()
{
QString path = QDir::currentPath()+tr("/radiazione.ps");
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFileName(path);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Portrait);
QPrintDialog dialog(&printer);
if ( dialog.exec() )
{
QwtPlotPrintFilter filter;
if ( printer.colorMode() == QPrinter::GrayScale )
{
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
}
print(printer, filter);
}
}
No errors, anyway the result of the printing is wrong, because
1) the axis are not shown (the ticks are shown)
2) the content of the plot, not the box, is shifted down.
I put the code for completeness.
void OptimumPlot::printOut()
{
QString path = QDir::currentPath()+tr("/radiazione.ps");
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFileName(path);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Portrait);
QPrintDialog dialog(&printer);
if ( dialog.exec() )
{
QwtPlotPrintFilter filter;
if ( printer.colorMode() == QPrinter::GrayScale )
{
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
}
print(printer, filter);
}
}