PDA

View Full Version : How can i change Highlight position in Qt4 Window with navigation ( Arrows ) key ?



duc_bkav
2nd November 2011, 04:27
Dear all,
i have a trouble when i attempt to change my highlight position on my main Window.
My mainwindow have 3 tabs, 1 textboxm, some button and a listview.
Now, if i want to switch ( change highlight position ) between these objects above on my mainwindow, i'll have to use TAB button on my key board.
Between 3 tab ( Recents, Contacts, Presentation ) , i can use Left-Right Arrow Key.
But in situation when i'm at Contacts, i want to move highlight position down to textbox, i cannot use Down key to move down Highlight point directly to the textbox, and of course, using Tab key, i can finally move Highlight point to textbox but i have to experience the Presentation tab.
That thing is not comfortable

Somebody can tell me which atributte of these objects that i can edit to sastisfy this purpose of navigation contron Highlight Poing on a Qt Window.

This is my GUI .
7061

Best regards..

Added after 39 minutes:

i think my problem is "Tab Order".
Does Qt default that all the tabs are arranged in sequential and if i want to move between these tabs, the only way is using Tab key and move tab-by-tab ??

Please help me

duc_bkav
4th November 2011, 07:46
can somebody help me :(

ChrisW67
4th November 2011, 09:16
I assume when you say "highlight position" you mean what the rest of the GUI world calls focus. There is an order and yes, you move through visible, active, focus-accepting widgets in order using <tab> and <shift><tab> by default, or by using the mouse. Pressing <enter> in a line edit will typically move focus to the next widget. You can define what that tab order is. This is more or less universal default behaviour and not unique to Qt. It is all spelt out in glorious detail in the documentation.

If you want some other form of navigation, for example using cursor keys (like the tab strip does with left-right) or skipping a widget based on some other widget's content, then you need to code that.

With a tabbed widget like yours using <tab> moves focus from the tab strip through all the widgets on the visible tab page (in the defined order) and then back to the tab strip. It will not switch to another tab page and cycle through widgets there unless you deliberately change the visible tabbed page. In light of that,

But in situation when i'm at Contacts, i want to move highlight position down to textbox, i cannot use Down key to move down Highlight point directly to the textbox, and of course, using Tab key, i can finally move Highlight point to textbox but i have to experience the Presentation tab.makes no sense.

duc_bkav
4th November 2011, 10:38
If you want some other form of navigation, for example using cursor keys (like the tab strip does with left-right) or skipping a widget based on some other widget's content, then you need to code that.

Thank Chris so much,
I see that Qt doesn't have feature to adjust the way we change the focus point as i look forward and if i want to , i have to code myself.

Anyway, thank for your support :)