PDA

View Full Version : Focus Help please



munna
15th November 2006, 06:15
Hi,

I have a TabWidget in which every tab has ScrollView. Each ScrollView in turn has 4 or more LineEdits.

When I click on the Tab bar to change the current page, one of the line edits of the current page gets the focus and the reason it shows is QFocusEvent::Mouse.

1. How can I prevent the line edits from getting the focus when the tab is changed?
2. Why is reason() showing Mouse when actually it is something else ?

Thanks a lot

nikita
15th November 2006, 06:43
setReason/resetReason?

munna
15th November 2006, 17:56
setReason/resetReason?

Can you please explain this a little more?

Thanks a lot

jpn
15th November 2006, 18:09
1. So which widget should get/retain the focus then? Maybe you could set a focus proxy (http://doc.trolltech.com/3.3/qwidget#setFocusProxy)?
2. Isn't clicking on a tab a mouse action? :)