labscript-suite-temp-2 / runmanager

runmanager is a graphical user interface (GUI) used to aid the compilation of labscript experiment scripts into hardware instructions to be executed on the hardware. Experiment parameters can be adjusted in the GUI, and lists of parameters can be used to create sequences of experiments, and scan over complex parameter spaces.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Navigation while editing globals (via tab key) is broken #6

Closed philipstarkey closed 10 years ago

philipstarkey commented 10 years ago

Original report (archived issue) by Philip Starkey (Bitbucket: pstarkey, GitHub: philipstarkey).


Regression in v2

Hitting tab when editing a cell in the globals treeview seems really screwy. It takes you to the next row, when I would expect it to take you to the cell in the next column.

I also liked the behaviour in runmanager (v1) where pressing tab on the units column was equivalent to hitting enter (you've finished editing at this point and are unlikely to want to go to the expansion column).

You can exploit the above behaviour to enter values/units/expansions for the "" line and the only way to remove such entries is to exploit the above behaviour again.

philipstarkey commented 10 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Mostly resolved in cf4f38006d4011c505ddf76f8f05afd9228338b7, by overriding QTreeView.moveCursor to return indices to the left/right of the current one instead of above/below.

I didn't make it handle the units column specially, but I just realised how to do so trivially - I thought Qt needed me to return a QModelIndex from QTreeView.moveCursor, but it turns out if I return a null index it appears to be content and not try to edit anything. So I'll do that in a sec. But I think it's fair enough to steer users away from changing expansion without really meaning to, and if they want to do so by keyboard navigation they can just hit right then enter.

philipstarkey commented 10 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Fixed in 3851f41ba1dfdc058110e3193e8e22e3d84b0987.

Added a new role for the item model called ROLE_IGNORE_TABNEXT. The treeview's moveCursor method checks this, and if it's set and True, returns a null index rather than the index for the expansion item one cell over.