Screenshots with custom (non-Qt) rendering classes or OpenGL

Last edited on

Overview

The names of custom Qt classes which do their own non-Qt based rendering (for example, those using OpenGL), must be specified in the environment variable SQUISH_GRABWINDOW_CLASSES. Multiple classes can be included, simply by separating them with commas.

For the specified classes Squish will take the screenshot directly from the operating system instead of using Qt's QPixmap::grabWidget() function.

Example for Unix-like systems

export SQUISH_GRABWINDOW_CLASSES=MyClass1,MyClass2
~/opt/squish-4.x-etc/bin/squishide

Alternative form that avoids changing the environment:

SQUISH_GRABWINDOW_CLASSES=MyClass1,MyClass2 ~/opt/squish-4.x-etc/bin/squishide

If you need to do this a lot it will be more convenient to put the two lines above into a shell script (e.g., a .sh file) and use that for starting the Squish IDE. (Of course, if you invoke the squishserver yourself, you must remember to also set this environment variable first.)

Example for Windows

set SQUISH_GRABWINDOW_CLASSES=MyClass1,MyClass2
C:\Squish-4.x-etc\bin\squishide.exe

If you need to do this a lot it will be more convenient to put the two lines above into a .bat file and use that for starting the Squish IDE. (Of course, if you invoke the squishserver yourself, you must remember to also set this environment variable first.)

Using the operating system for all screenshots

To use the operating system (instead of functionality provided by Qt) for all screenshots set SQUISH_GRABWINDOW_CLASSES to "QWidget".

Using the operating system for screenshots of all OpenGL objects

To use the operating system (instead of functionality provided by Qt) for screenshots of all OpenGL objects set SQUISH_GRABWINDOW_CLASSES to "QGLWidget,QWSGLWindowSurface" (also see QtOpenGL Module for a list of Qt's OpenGL classes).

On Unix systems:

export SQUISH_GRABWINDOW_CLASSES=QGLWidget,QWSGLWindowSurface
~/opt/squish-4.x-etc/bin/squishide

On Windows systems:

set SQUISH_GRABWINDOW_CLASSES=QGLWidget,QWSGLWindowSurface
C:\Squish-4.x-etc\bin\squishide.exe