ctrl-tab doesn't work in windows with pyqt

15 views
Skip to first unread message

June Kim

unread,
Jan 8, 2010, 12:15:32 PM1/8/10
to leo-e...@googlegroups.com
Hello, everyone.

ctrl-tab (currently binded to cycle-focus) doesn't work in windows
with pyqt. The event isn't generated at all. Manually calling with
alt-x "cycle-focus" works. It seems that there is some problem with
key binding and event catching. Strangely, though, ctrl-shift-tab
(cycle-all-focus) works just fine.

tk gui(launched with --gui option) works just fine with ctrl-tab.

version info:
* windows xp sp3
* Leo 4.7 beta 1
* PyQt 4.7 rc2-1
* Python 2.6.4

June Kim

unread,
Jan 8, 2010, 12:43:49 PM1/8/10
to leo-e...@googlegroups.com
What I describe in the previous post was about key event getting
ignored. It had nothing to do with cycle-focus' functionality.

Now I found another problem. It's about cycle-focus' functionality. It
has a bug.

As I cycle-focus repeatedly, I don't travel around the three
panes(body,log,outline). Once I get into the log pane, it always goes
back to the body pane.

body = c.frame.body.bodyCtrl
log = c.frame.log.logCtrl
tree = c.frame.tree.canvas
panes = [body,log,tree]

if w in panes:
i = panes.index(w) + 1
if i >= len(panes): i = 0
pane = panes[i]
else:
pane = body

The problem is, the variable "log" and the log pane is different from
each other and hence the if body is by-passed

For example, "log" holds "leoQTextEditWidget: 31135264", whereas
w(current pane) holds <leo.plugins.qtGui.leoQtLog instance at
0x01DF9788> on one running.

June Kim

unread,
Jan 8, 2010, 6:45:42 PM1/8/10
to leo-e...@googlegroups.com
I seem to have found the cause of this bug:

# 'Tab':'Tab',
'Tab':'\t', # A hack for QLineEdit.

in qtGui.py

When 'Tab':'Tab' is uncommented and the next line is commented
instead, tab key in outline editing(using QLineEdit) isn't working
properly(it prints "TAB" string in the edit line instead), whereas
ctrl-tab works just fine to travel around(except that log pane bug
that I mentioned earlier).

As just a novice in leo, I can't tell what would be a decent fix.


On Sat, Jan 9, 2010 at 2:15 AM, June Kim <june...@gmail.com> wrote:

Edward K. Ream

unread,
Jan 8, 2010, 9:48:59 PM1/8/10
to leo-editor

On Jan 8, 5:45 pm, June Kim <junea...@gmail.com> wrote:
> I seem to have found the cause of this bug:
>
>         # 'Tab':'Tab',
>         'Tab':'\t', # A hack for QLineEdit.
>
> in qtGui.py
>
> When 'Tab':'Tab' is uncommented and the next line is commented
> instead, tab key in outline editing(using QLineEdit) isn't working
> properly(it prints "TAB" string in the edit line instead), whereas
> ctrl-tab works just fine to travel around(except that log pane bug
> that I mentioned earlier).

Very good work. This is an excellent time for this report: I have
spent most of today studying the key-handling code and it's
implications.

> As just a novice in leo, I can't tell what would be a decent fix.

I can't tell either :-) This is supremely tricky code, with effects
throughout Leo. I have made some good conceptual progress today, and
I'll write up my thoughts tonight or tomorrow.

Edward

Edward K. Ream

unread,
Jan 18, 2010, 10:16:30 AM1/18/10
to leo-editor

On Jan 8, 11:43 am, June Kim <junea...@gmail.com> wrote:

> Now I found another problem...As I cycle-focus repeatedly, I don't travel around the three
> panes(body,log,outline).

The fix is on the trunk at rev 2695.

Edward

Edward K. Ream

unread,
Jan 18, 2010, 10:17:59 AM1/18/10
to leo-editor

On Jan 8, 11:15 am, June Kim <junea...@gmail.com> wrote:

> ctrl-tab (currently binded to cycle-focus) doesn't work in windows
> with pyqt.

The fix is on the trunk at rev 2695. All unit tests pass on qt and
tk. The fix is small, but it might have unintended side effects.
Please report any key binding problems immediately.

Edward

Reply all
Reply to author
Forward
0 new messages