PDA

View Full Version : Tab border higllights when tab key is use to switch between tabs in qTabWidget



firewater
8th June 2011, 03:07
I have added about 7 tabs in a QTabWidget using the addTab(...) function.

1). When I use tab key to navigate through the tabs i.e. tab key to get focus to tab, and then left and right arrow keys to switch through the tabs, the border highlights of the pane or tab highlights. Is there a way to not have this effect?

2). I am also allowing the the scroll button if the window size is small. Hitting tab key after the one of the tab takes focus, the focus goes to this scroll button instead of the tab-page widget. Is there a way to specify the order?

I have tried setTabOrder function but it doesn't work. Can anyone help?

DanH
8th June 2011, 03:22
If you don't want to use tabbing for your tabs (if that makes sense), set their focus policy to "none". Otherwise you need to research how to turn off the focus rectangle -- can be done but how varies based on Qt version, et al.

firewater
8th June 2011, 03:28
I need to have tabbing functionality, but thanks for the reply. Just a quick question, do you know how to not let the scroll arrow buttons take focus?

Santosh Reddy
8th June 2011, 05:38
What I understand from your explanation is that your tab order is working as expected. Could you post a simple sketch of the widget, if possible.

Things are not very clear, do you have tab widget in the scroll area? or each (or one of the) tab page has scroll bar ?

I think you need to review / rethink both the widget hierarchy, and tab ordering, adjusting them slightly should achieve what you want.

firewater
8th June 2011, 23:17
No i do not have any widget in any scroll area, but what I am talking is in the following picture.

65576558

Here is the problem: If i set the QTabWidget focus policy to NoFocus then it works fine, but cannot use tab key + arrow keys to move focus between tabs.

If i set it to tabfocus or strongfocus then I can use tab + arrow key to move focus between tabs, but the white line as displayed in second picture comes up.

This happens with QCDEStyle, but not with QPlastiqueStyle. I need to use QCDEStyle so I am wondering if there is a way to fix this.

Thanks!