Skip to main content

DeMille Lab Widgets for PyQt5

Small, reusable PyQt5 widgets developed for laboratory control-system interfaces.

The package improves several common Qt interactions, including preventing spin boxes and combo boxes from changing when the mouse wheel is used while the widget does not have focus. It also provides cursor-position-aware numeric stepping, scientific-notation input, convenience layouts, a configured plotting widget, and a table widget with frozen rows and columns.

Installation

Once the first release is published to PyPI:

python -m pip install demille-lab-widgets-pyqt5

Usage

from demille_lab_widgets import NewBox, NewDoubleSpinBox, NewSpinBox

voltage = NewDoubleSpinBox(range=(-10.0, 10.0), decimals=3, suffix=" V")
shots = NewSpinBox(range=(0, 100_000))
controls = NewBox(layout_type="form")
controls.frame.addRow("Voltage", voltage)
controls.frame.addRow("Shots", shots)

The public classes are:

  • NewBox
  • NewComboBox
  • NewSpinBox
  • NewDoubleSpinBox
  • ScientificDoubleSpinBox
  • NewPlot
  • NewScrollArea
  • FlexibleGridLayout
  • NewTableWidget

Behavior

NewSpinBox, NewDoubleSpinBox, and NewComboBox ignore mouse-wheel changes until they have keyboard focus. The numeric spin boxes also change their step size according to the cursor position. Keyboard tracking is disabled so typed values are committed when Enter is pressed or focus is lost.

NewBox exposes its layout as frame and keeps zero margins around it. In form mode the box is drawn without a border; calling setTitle() adds back only the vertical space the title text needs.

Development

Create a virtual environment, then install the package in editable form:

python -m pip install -e ".[test]"
python -m unittest discover -s tests -v
python -m build
python -m twine check dist/*

Release status

The package implementation is maintained independently in this repository and is distributed under the MIT License. Runtime dependencies retain their own licenses; see Third-party notices.

Acknowledgements

The widget collection was originally developed for CeNTREX by Olivier Grasdijk and Jakob Kastelic. Qian Wang subsequently brought it into the SrF control software and developed additional improvements. Shaozhen Yang later adapted it for FrAg, extracted it into this standalone package, coordinated the licensing review, and prepared the public release. See the full project history and contributors.

Download files

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

Source Distribution

demille_lab_widgets_pyqt5-0.1.3.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demille_lab_widgets_pyqt5-0.1.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file demille_lab_widgets_pyqt5-0.1.3.tar.gz.

File metadata

File hashes

Hashes for demille_lab_widgets_pyqt5-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a34a2fc6b9890142af7108a99e20e8135248f007b1320110d546b24f6f281faa
MD5 faab43b5c0d12376fad5f00037d4176f
BLAKE2b-256 eba630dce7e6cdbb2d46aa900665b8aa74d7de411baefdaf4def51ecca57a49b

See more details on using hashes here.

Provenance

The following attestation bundles were made for demille_lab_widgets_pyqt5-0.1.3.tar.gz:

Publisher: release.yml on DeMille-Group-FrAg/demille-lab-widgets-pyqt5

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file demille_lab_widgets_pyqt5-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for demille_lab_widgets_pyqt5-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d34fe5d753b48ab2f99d94bd6c061ef3e8317dc132139ba52c00ee1c06d5856
MD5 14f4e9aa6afe4bec5ddd6252cf61f84d
BLAKE2b-256 47ccab7acf27c4e1ba0ced4b01a936dc6f0ffdf5707ab88edd8b912990abf808

See more details on using hashes here.

Provenance

The following attestation bundles were made for demille_lab_widgets_pyqt5-0.1.3-py3-none-any.whl:

Publisher: release.yml on DeMille-Group-FrAg/demille-lab-widgets-pyqt5

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page