giusepped
21st January 2009, 08:31
I have set the brush as in this code
plotEnergy = new QwtPlotCurve();
plotEnergy->attach(this);
plotEnergy->setPen(QPen(Qt::red));
plotEnergy->setBrush(QBrush(Qt::Dense7Pattern));
But when export the pdf I get the picture attached.
The export is done as simple as:
QString fileName;
fileName = QFileDialog::getSaveFileName(this, tr("Nome file da esportare"), QDir::homePath(),"Acrobat ( *pdf)");
if ( !fileName.isEmpty() ) {
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Landscape);
QwtPlotPrintFilter filter;
// if ( printer.colorMode() == QPrinter::GrayScale )
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
print(printer,filter);
plotEnergy = new QwtPlotCurve();
plotEnergy->attach(this);
plotEnergy->setPen(QPen(Qt::red));
plotEnergy->setBrush(QBrush(Qt::Dense7Pattern));
But when export the pdf I get the picture attached.
The export is done as simple as:
QString fileName;
fileName = QFileDialog::getSaveFileName(this, tr("Nome file da esportare"), QDir::homePath(),"Acrobat ( *pdf)");
if ( !fileName.isEmpty() ) {
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
printer.setCreator("Solar Calc");
printer.setOrientation(QPrinter::Landscape);
QwtPlotPrintFilter filter;
// if ( printer.colorMode() == QPrinter::GrayScale )
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
print(printer,filter);