enthought / enthought/traitsui
A `RangeEditor` editing a `Range` trait will not use the trait's `low` and `high` settings
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Using qt (pyside6 6.2.3) with the latest traitsui release (7.4.3).
A `RangeEditor` that edits a `Range` trait will ignore the trait's `low` and `high` and will default to 0.0 - 1.0 instead:
```python
from traits.api import HasStrictTraits, Range
from traitsui.api import View, Item, RangeEditor
class FixedRange(HasStrictTraits):
a_range = Range(low=0, high=72, value=1)
def default_traits_view(self):
return View(
Item("a_range", style="custom", editor=RangeEditor(mode="slider")),
width=330, height=60,
title="Editor will not inherit low/high"
)
FixedRange().configure_traits()
```

(_Expected: slider going from 0 to 72 instead of 0.0 to 1.0_)
The same happens with other modes ("spinner").
**Known workaround**: assign `low` and `high` manually.
**Limitation**: this is unfeasible if the `Range` trait uses extended trait names for `low` and `high`.
---
_Addendum._ I should also point out that if the `RangeEditor` is then used, it will likely generate invalid trait values (in this case, `Range` is validating to `int` because high, low and value are ints; `RangeEditor` however produces floats because it ignored these parameters).
It surprised me that the exception is displayed to the user with a dialog rather than with a "failed validation" color.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.