View Full Version : Problem with push button navigation

8th April 2011, 11:08
Hi friends

I have made one screen in Qt.

In my first screen there are four push buttons are there. Now i have apply focus in event on that. So when ever i press tab key it get focused.

but now i want is that when my focus reach to last button and than again if i press tab key it should come again to first push button. It comes after 4 to 5 times pressing of tab key.

so how can i restrict that navigation? Please suggests me with some source code how can i do that?

Please help me to solve this problem.

8th April 2011, 12:31
Did you set the tab order for your widgets in Designer/Creator? Do all of your buttons accept focus?

11th April 2011, 07:00

thanks for your suggestion. I have tried to set tab order as mention below... Please check it is it perfect or not? I have four push button whose pointers are

pushButton, pushButton_2,pushButton_3 , pushButton_4. So i have set tab order.


But still is not working as i wanted it to work. When focus is on last push button and i press tab it comes over 1st button. but when i press tab again it takes 5 to 6 tabs to go on to next push button. Please tell me some solutions for this...

Thanks in advance.
waiting for your reply...

11th April 2011, 10:24
Where is the focus during those "5 to 6 tabs"?

12th April 2011, 05:53

thanks for your reply.
But what you asking I am not clear about it?
am i missing any syntex which need to be written ?
Please tell me what to do?

I am stuck with this problem...

12th April 2011, 13:21
When you press the tab key it causes focus to move to the next widget. So I'm asking where does the focus move to during the action you described here:

but when i press tab again it takes 5 to 6 tabs to go on to next push button.

13th April 2011, 14:23

I have four push buttons. I have set tab order of all four of them.


When i press tab first it selects fist push button, but when i press tab focus just disappears.
And after pressing 4 to 5 tabs it selects second push button. Than if i press tab again it directly selects push button 3 and so on. But between first and second push button it takes more tabs. Can you please tell why these happen.

One more thing i want to tell. I have one form on that i have take stack widget and on that its graphics view and after that i have put push buttons.

So because of these problem occurs or what?

Please reply me.

13th April 2011, 16:55
When i press tab first it selects fist push button, but when i press tab focus just disappears.
It doesn't dissapear. It moves to another widget. It might not be one of the push buttons you have. In doubt check QApplication::focusWidget().

14th April 2011, 07:43
thanks so much for your support.
I have solve the problem......
once again thanks so much........

15th April 2011, 06:57

I have attach one png file here. I want to create screen like in that image. how can i create menus

19th July 2011, 13:18
hi ,

Please try this :
u have any widget other than push button like(graphic view)?
If u have widget other than push button than go every widget in .ui file and set no focus property in the property of that particular widgets.
all the push button has strong focus property..