*/
bool Plot2d_ViewFrame::print( const QString& file, const QString& format ) const
{
-#ifdef WIN32
- return false;
-
-#else
bool res = false;
if( myPlot )
{
QPaintDevice* pd = 0;
- if( format=="PS" || format=="EPS" )
+ if( format=="PS" || format=="EPS" || format == "PDF")
{
QPrinter* pr = new QPrinter( QPrinter::HighResolution );
+ if(format == "PDF")
+ pr->setOutputFormat(QPrinter::PdfFormat);
pr->setPageSize( QPrinter::A4 );
pr->setOutputFileName( file );
pr->setPrintProgram( "" );
}
}
return res;
-#endif
}
/**
*/
void Plot2d_ViewWindow::RefreshDumpImage()
{
- QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+ QPixmap px = QPixmap::grabWidget( myViewFrame );
myDumpImage = px.toImage();
}
QImage Plot2d_ViewWindow::dumpView()
{
if ( getToolBar()->underMouse() || myDumpImage.isNull() ) {
- QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+ QPixmap px = QPixmap::grabWidget( myViewFrame );
return px.toImage();
}