tags:

views:

33

answers:

3

I need to forbid the tab input in a QPlainTextEdit widget. Instead tab should be used has a "focus next" widget. It seems that setTabChangesFocus(bool) is made for that but setting it to true has no effect. I guess it's a Qt bug. Did anyone experiences the same issue and find a solution?

I'm using Qt 4.5.2 on snow leopard.

Thanks, Boris

A: 

Hey

I'm using Qt 4.5.3 and I quickly tested it in my app, you're absolutely right, setTabChangesFocus(true) should switch from "tab into the TextEdit" to "tab to change focus"...

I'm on windows XP tho, did you reimplement QPlainTextEdit ?

In the meantime, if you really don't find the source of your problem, you could maybe use a EventFilter...

Andy M
A: 

Thanks Andy, I actually found a solution. It seems that you need to put it inside another widget (a groupbox for example) and it should work.

Boris.

Boris Gougeon
+1  A: 

The correct solution to this is to use a focus proxy widget. See:

http://doc.qt.nokia.com/4.5/qwidget.html#setFocusProxy

Henrik Hartz