114 void ViewToolset::screenshot() |
114 void ViewToolset::screenshot() |
115 { |
115 { |
116 const char* imageFormats = "PNG images (*.png);;JPG images (*.jpg);;BMP images (*.bmp);;" |
116 const char* imageFormats = "PNG images (*.png);;JPG images (*.jpg);;BMP images (*.bmp);;" |
117 "PPM images (*.ppm);;X11 Bitmaps (*.xbm);;X11 Pixmaps (*.xpm);;All Files (*.*)"; |
117 "PPM images (*.ppm);;X11 Bitmaps (*.xbm);;X11 Pixmaps (*.xpm);;All Files (*.*)"; |
118 QImage image = m_window->renderer()->screenCapture(); |
118 QImage image = m_window->renderer()->screenCapture(); |
119 QString root = Basename (currentDocument()->name()); |
119 QString root = QFileInfo {currentDocument()->name()}.fileName(); |
120 |
120 |
121 if (root.right (4) == ".dat") |
121 if (root.right (4) == ".dat") |
122 root.chop (4); |
122 root.chop (4); |
123 |
123 |
124 QString defaultname = (not root.isEmpty()) ? format ("%1.png", root) : ""; |
124 QString defaultname = (not root.isEmpty()) ? format ("%1.png", root) : ""; |