PDA

View Full Version : setfocus working?



mahe2310
9th March 2006, 10:52
My appln need to change focus from current listbox to the pushbutton in the screen when a specific key pressed.
How can i make this happen?

mahe2310

zlatko
9th March 2006, 10:57
Em...why you don want use TAB ?

p.s. sorry man but are you dont take solution from your previous thread (http://www.qtcentre.org/forum/showthread.php?t=1063)
:confused:

mahe2310
9th March 2006, 11:04
Em...why you don want use TAB ?

p.s. sorry man but are you dont take solution from your previous thread :confused:

i dont want to use all the keys in my application.
So on Right arrow press i just want to propagate to pushbutton.

i do use all helps suggested by u ppl.
I am able to deal with my listbox as i need except changing focus...

Can u help me...

Mahe2310

zlatko
9th March 2006, 11:20
have you catch specified key pressed?

mahe2310
9th March 2006, 11:45
have you catch specified key pressed?


yes...

mahe2310

zlatko
9th March 2006, 11:55
put next code in your handler


if ( listBox->hasFocus())
pushButton->setFocus();

mahe2310
9th March 2006, 13:02
put next code in your handler


if ( listBox->hasFocus())
pushButton->setFocus();



I got a doubt... Where should i call this function. Is it possible at ListBox::keyPressEvent()?

Mahe2310

zlatko
9th March 2006, 16:02
You need call this code there where you catch your arrow pressed

mahe2310
10th March 2006, 03:45
You need call this code there where you catch your arrow pressed


sorry... it is nt working...
mahe2310