pythonqtcanopyenaml

Enaml slider arrow keys not working


I'm using enaml and trying to get a slider that can also be controlled with the arrow keys. I've used the slide example from the gallery (which doesn't work out-of-the-box, and gives a math domain error, but can be fixed by removing the log). According to the slider documentation there is a single_step property that:

defines the number of steps that the slider will move when the user presses the arrow keys

This seems to have a default of 1, but in my case nothing happens when I press the arrow keys. I wrote it explicitly under Slider: (and tried using larger values), but to no avail. Nothing seems to happen when I press the arrow keys.

I'm using enable 0.6.8 from Canopy in OS X, with the Qt backend. I wonder if this is a backend limitation? I had similar issues with sliders not being able to be controlled with the keyboard with TraitsUI as well.


Solution

  • Enaml 0.6.8 is 30 versions old now. Please upgrade to the latest version. The Anaconda distribution ships with a reasonably recent version of Enaml.

    That being said, this issue is still present in trunk. It looks to be an issue on OSX|Qt when a slider is a sibling of another widget which can accept focus. For reasons which I have not yet pinned down, the QSlider will not gain input focus on click or tab press.

    On Windows, everything works as advertised.

    Feel free to open a ticket, and I'll dig into it more when I have some free time: https://github.com/nucleic/enaml