How do I generate documentation screenshots for a Qt application?

700 Views Asked by At

Without manual intervention I would like to generate screenshots of a Qt desktop application. The screenshots should be generated when the make documentation make target is being issued. So in the source tree there are no PNG files containing screenshots but instead there are automated instructions of how to produce them.

An advantage of generating the screenshots would be that the documentation would always stay accurate. It would cope with the problem that the visual appearance of Qt widgets might change over time. Another advantage would be that screenshots for different Qt styles could be created. A Qt style is chosen by using QApplication::setStyle() or by starting the app with the -style command line option.

I guess there are be two approaches of how to achieve my goal.

  • Record all mouse events and key strokes that are needed to bring the application into the state where the screenshot is being taken.

  • Make the Qt application scriptable, and write a script that brings the application into the state where the screenshot is being taken

Is there any third-party software that could automate the first approach? Should I use QtScript for the second approach? Are there other ways of how to accomplish my goal? Are there any open source Qt applications that generate their documentation screenshots in their build system?

0

There are 0 best solutions below