Salome HOME
Modify default icon for the module
[modules/gui.git] / src / Plot2d / Plot2d_ViewWindow.cxx
index 7f7ed5ef3d8cc6c16c9e42129f7af8ec555e9d77..6a5d512dc358eea8e37d1fc6b27d4faaeb4262a7 100755 (executable)
@@ -10,6 +10,7 @@
 
 #include <qstatusbar.h>
 #include <qlayout.h>
+#include <qapplication.h>
 
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
@@ -341,12 +342,6 @@ void Plot2d_ViewWindow::onChangeLegendMode()
   myActionsMap[ LegendId ]->setOn(myViewFrame->isLegendShow());
 }
 
-//****************************************************************
-void Plot2d_ViewWindow::onDumpView()
-{
-  myViewFrame->onDump();
-}
-
 //****************************************************************
 void Plot2d_ViewWindow::onFitAll()
 {
@@ -425,3 +420,17 @@ void Plot2d_ViewWindow::onCurves()
     myViewFrame->setCurveType(2);
   }
 }
+
+//****************************************************************
+void Plot2d_ViewWindow::onDumpView()
+{
+  qApp->postEvent( myViewFrame, new QPaintEvent( QRect( 0, 0, myViewFrame->width(), myViewFrame->height() ), TRUE ) );
+  SUIT_ViewWindow::onDumpView();
+}
+
+//****************************************************************
+QImage Plot2d_ViewWindow::dumpView()
+{
+  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+  return px.convertToImage();
+}