Skip to main content

sphinx-gallery scraper for Qt examples and tutorials

Project description

Documentation Status

Scraper for generating a sphinx-gallery of Qt widgets.

This repository serves both as a library for grabbing renderings of Qt widgets to add to your own sphinx-gallery config as well as an example of its usage.

Installation

For the time being, clone the repo and install from source:

$ git clone git@github.com:ixjlyons/qtgallery.git
$ cd qtgallery
$ pip install .

Now you should be able to generate the docs/gallery:

$ cd doc
$ make html

Open up doc/_build/html/index.html to see built docs. They’re currently being hosted by Read the Docs as well:

https://qtgallery.readthedocs.io/

Configuration

To use qtgallery in your own documentation, start by setting up sphinx-gallery. This library provides two key components to add to your sphinx_gallery_conf: an image scraper and a reset function:

# sphinx conf.py
import qtgallery

sphinx_gallery_conf = {
    ...
    'image_scrapers': (qtgallery.qtscraper, ...),
    'reset_modules': (qtgallery.reset_qapp, ...),
    ...
}

The image scraper is responsible for generating a rendering of all currently shown top level widgets.

The reset function is for handling QApplication, allowing you to instantiate the QApplication singleton in each example and preventing the Qt event loop from running and hanging the docs build. That is, examples that run ok standalone should behave ok in generating the gallery.

Usage

Usage pretty much follows sphinx-gallery, but one tip is that you can control where the widget/window is rendered via show(). See the iterative example to see how this works.

Read the Docs

On Read the Docs, xvfb is required. See their documentation for installing apt packages. This repository also serves as an example (see .readthedocs.yml).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtgallery-0.0.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

qtgallery-0.0.2-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file qtgallery-0.0.2.tar.gz.

File metadata

  • Download URL: qtgallery-0.0.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for qtgallery-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3ac04cbb7e749321ca9fa74ef926ed882cfcc71738c79935402ca7803bb57ba3
MD5 775be9edb7b02db6e8a09d2370378c8c
BLAKE2b-256 e8cf032ef83a525688fe08436ec2c3c9399ccb4852bc5b23b2648085dfab124f

See more details on using hashes here.

File details

Details for the file qtgallery-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: qtgallery-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for qtgallery-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 635aa06ac503c41ebca59879c600292021a52ac8933c6360fa895479f40a1b90
MD5 de9f30036923155ed1894bda67c16126
BLAKE2b-256 f669e1ab987b1b31a7c91e334b652b51b66b158861757fb9befa616f9202483d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page