Metadata-Version: 2.4
Name: demille-lab-widgets-pyqt5
Version: 0.1.3
Summary: Improved PyQt5 widgets for laboratory control systems
Author: Olivier Grasdijk, Jakob Kastelic, Qian Wang, Shaozhen Yang
License-Expression: MIT
Project-URL: Homepage, https://github.com/DeMille-Group-FrAg/demille-lab-widgets-pyqt5
Project-URL: Repository, https://github.com/DeMille-Group-FrAg/demille-lab-widgets-pyqt5
Project-URL: Issues, https://github.com/DeMille-Group-FrAg/demille-lab-widgets-pyqt5/issues
Keywords: PyQt5,Qt,widgets,laboratory,control-system
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Requires-Dist: numpy>=1.21
Requires-Dist: PyQt5>=5.15
Requires-Dist: pyqtgraph>=0.12
Provides-Extra: test
Requires-Dist: build>=1.2; extra == "test"
Requires-Dist: twine>=6; extra == "test"
Dynamic: license-file

# 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:

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

## Usage

```python
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:

```console
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](LICENSE). Runtime dependencies retain
their own licenses; see [Third-party notices](THIRD_PARTY_NOTICES.md).

## 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](https://github.com/DeMille-Group-FrAg/demille-lab-widgets-pyqt5/blob/main/AUTHORS.md).
