API

qtgallery.qtscraper(block, block_vars, gallery_conf)

Basic implementation of a Qt window scraper.

Looks for any non-hidden windows in the current application instance and uses grab to render an image of the window. The window is closed afterward, so you have to call show() again to render it in a subsequent cell.

processEvents is called twice with a delay between in case events still need to propagate.

Intended for use in image_scrappers in the sphinx-gallery configuration.

qtgallery.reset_qapp(gallery_conf, fname)

Shutdown an existing QApplication and disable exec_.

Disabling QApplication.exec_ means your example scripts can run the Qt event loop (so the scripts work when run normally) without blocking example execution by sphinx-gallery.

Intended for use in reset_modules in the sphinx-gallery configuration.