]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Allow to made photo if view is not visible. Added PDF support.
authorvtn <vtn@opencascade.com>
Tue, 19 Mar 2013 10:37:22 +0000 (10:37 +0000)
committervtn <vtn@opencascade.com>
Tue, 19 Mar 2013 10:37:22 +0000 (10:37 +0000)
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewWindow.cxx

index 4559f433cbd69f08fb7ba9f987e1d09181c16191..93e7509c9467bf4b9140502d8204784e676d0c44 100755 (executable)
@@ -3256,17 +3256,15 @@ void Plot2d_ViewFrame::updateTitles()
 */
 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( "" );
@@ -3281,7 +3279,6 @@ bool Plot2d_ViewFrame::print( const QString& file, const QString& format ) const
     }
   }
   return res;
-#endif
 }
 
 /**
index 56424b9a1a96c7b68461b73538cd5d4a72c21af9..2d9475b5323c14724d503f0ead1568aac52f7b81 100755 (executable)
@@ -528,7 +528,7 @@ void Plot2d_ViewWindow::setVisualParameters( const QString& parameters )
 */
 void Plot2d_ViewWindow::RefreshDumpImage()
 {
-  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+  QPixmap px = QPixmap::grabWidget( myViewFrame );
   myDumpImage = px.toImage();
 }
 
@@ -742,7 +742,7 @@ void Plot2d_ViewWindow::onDumpView()
 QImage Plot2d_ViewWindow::dumpView()
 {
   if ( getToolBar()->underMouse() || myDumpImage.isNull() ) {
-    QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+    QPixmap px = QPixmap::grabWidget( myViewFrame );
     return px.toImage();
   }