Skip to content
Advertisement

Capturing high-quality(300dpi) screenshots of QT-based app in Linux

I need to make a screenshot of my form created in QT designer. There are numerous approaches to do screenshots(gimp, import, etc..) but alt of them deal with same dpi as on my monitor(about 100dpi). This is quite enough to publish on web site, but 300dpi images are required for paper publications. Are there any ways to create 300dpi screenshots?

Advertisement

Answer

Painting can be done on any QPaintDevice, which includes QPrinter. If you wanted to, you could set up painting redirection to a given device, then have the widget repaint itself. This might give you the higher precision you desire. For more information, look on Qt’s website for the Paint System overview, and also maybe look at the QPixmap::grabWidget functions.

Advertisement