From 27bcfc4c8e497fd406e4f03e5e824499ccc320fb Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 2 Jun 2021 20:36:23 -0400 Subject: [PATCH] update readme --- README.md | 10 +++++----- docs/{RangeSlider.md => sliders.md} | 29 ++++++++++++++++------------- tox.ini | 1 - 3 files changed, 21 insertions(+), 19 deletions(-) rename docs/{RangeSlider.md => sliders.md} (97%) diff --git a/README.md b/README.md index f191f99..e9be14d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # qwidgets -**Missing widgets for PyQt/PySide** +### Missing widgets for PyQt/PySide [![License](https://img.shields.io/pypi/l/qwidgets.svg?color=green)](https://github.com/napari/qwidgets/raw/master/LICENSE) [![PyPI](https://img.shields.io/pypi/v/qwidgets.svg?color=green)](https://pypi.org/project/qwidgets) @@ -9,14 +9,14 @@ Version](https://img.shields.io/pypi/pyversions/qwidgets.svg?color=green)](https [![Test](https://github.com/napari/qwidgets/actions/workflows/test_and_deploy.yml/badge.svg)](https://github.com/napari/qwidgets/actions/workflows/test_and_deploy.yml) [![codecov](https://codecov.io/gh/napari/qwidgets/branch/master/graph/badge.svg)](https://codecov.io/gh/napari/qwidgets) - ## Widgets Widgets include: -- Float Slider -- Range Slider (multi-handle slider) -- Labeled Sliders (sliders with linked spinboxes) +- [Float Slider](docs/sliders.md#float-slider) +- [Range Slider](docs/sliders.md#range-slider) (multi-handle slider) +- [Labeled Sliders](docs/sliders.md#labeled-sliders) (sliders with linked + spinboxes) - Unbound Integer SpinBox (backed by python `int`) ## Contributing diff --git a/docs/RangeSlider.md b/docs/sliders.md similarity index 97% rename from docs/RangeSlider.md rename to docs/sliders.md index 09880ad..a2cab84 100644 --- a/docs/RangeSlider.md +++ b/docs/sliders.md @@ -1,6 +1,5 @@ -# QRangeSlider +# Sliders -**The missing multi-handle range slider widget for PyQt & PySide** ![slider](images/slider.png) @@ -13,9 +12,7 @@ ------ -## API - -To create a slider: +## Range Slider ```python from qwidgets import QRangeSlider @@ -86,7 +83,7 @@ These options are in addition to the Qt QSlider API, and control the behavior of | `barIsRigid` | `setBarIsRigid` | `bool` | `True` | Whether bar length is constant or "elastic" when dragging the bar beyond min/max. | ------ -## Examples +### Examples These screenshots show `QRangeSlider` (multiple handles) next to the native `QSlider` (single handle). With no styles applied, `QRangeSlider` will match the native OS @@ -148,23 +145,24 @@ QRangeSlider { -### macOS +#### macOS ##### Catalina + ![mac10](images/demo_darwin10.png) ##### Big Sur + ![mac11](images/demo_darwin11.png) -### Windows +#### Windows ![window](images/demo_windows.png) -### Linux +#### Linux ![linux](images/demo_linux.png) - ## Labeled Sliders This package also includes two "labeled" slider variants. One for `QRangeSlider`, and one for the native `QSlider`: @@ -195,7 +193,6 @@ Where/whether labels are shown adjacent to slider handles. - `LabelPosition.LabelsRight` (alias for `LabelPosition.LabelsAbove`) - `LabelPosition.LabelsLeft` (alias for `LabelPosition.LabelsBelow`) - #### `edgeLabelMode`/`setEdgeLabelMode` **type:** `QLabeledRangeSlider.EdgeLabelMode` @@ -208,7 +205,6 @@ Where/whether labels are shown adjacent to slider handles. - `EdgeLabelMode.LabelIsRange`: edge labels shown the min/max values - `EdgeLabelMode.LabelIsValue`: edge labels shown the slider range - #### fine tuning position of labels: If you find that you need to fine tune the position of the handle labels: @@ -218,7 +214,6 @@ If you find that you need to fine tune the position of the handle labels: ### `QLabeledSlider` - ![labeled_range](images/labeled_qslider.png) ```python @@ -233,3 +228,11 @@ If you encounter any problems, please [file an issue] along with a detailed description. [file an issue]: https://github.com/napari/qwidgets/issues + +## Float Slider + +just like QSlider, but supports float values + +```python +from qwidgets import QDoubleSlider +``` diff --git a/tox.ini b/tox.ini index ea0c2fc..40e95a8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,3 @@ -# For more information about tox, see https://tox.readthedocs.io/en/latest/ [tox] envlist = py{37,38,39}-{linux,macos,windows}-{pyqt5,pyside2,pyqt6,pyside6},py37-{linux,macos,windows}-{pyqt511,pyside511} toxworkdir=/tmp/.tox