mirror of
https://github.com/pyapp-kit/superqt.git
synced 2026-03-16 13:10:14 +01:00
* wip * simplified quantity widget * fix example * more docs * add test * update docs * try to avoid overflow * reduce again
34 lines
488 B
Markdown
34 lines
488 B
Markdown
# QQuantity
|
|
|
|
A widget that allows the user to edit a quantity (a magnitude associated with a unit).
|
|
|
|
!!! note
|
|
|
|
This widget requires [`pint`](https://pint.readthedocs.io):
|
|
|
|
```
|
|
pip install pint
|
|
```
|
|
|
|
or
|
|
|
|
```
|
|
pip install superqt[quantity]
|
|
```
|
|
|
|
```python
|
|
from qtpy.QtWidgets import QApplication
|
|
|
|
from superqt import QQuantity
|
|
|
|
app = QApplication([])
|
|
w = QQuantity("1m")
|
|
w.show()
|
|
|
|
app.exec()
|
|
```
|
|
|
|
{{ show_widget(150) }}
|
|
|
|
{{ show_members('superqt.QQuantity') }}
|