PDA

View Full Version : widget not able to recieve the focus...plz help me..



suma
13th March 2011, 07:29
hai...

i am facing the problem wile trying to give focus to the widget...

currently i have an application, which uses table widget property of QT... that is developed using QT creator.. the application runs well on my linux PC... now i have cross compiled it for MIPS..

now that.. the application is behaving weirdly...my application(say app2) actually gets launched by one more application, which was running initially(say app1)..
once my application is launched(app2).. it must actually be displayed on the screen directly..
but.. wat actually happening is...my application (app2) is getting displayed on the background of the currently running application(app1)... because of which.. my application (app2) is unable to recieve any of the keyboard events....

when i worked around this... came to know that.. my application window might not be recieving the focus.. bcoz of which its getting displayed on the background....

so i just wanted to know.. how to make my window focused???..
- i tried giving.. requestFocus() at the QT level after Createwindow() and setopacity().. so that it can be applied for all the applications.. but it actually dint work...:(

- so i thought of giving focus at the application level.. i mean.. directly to my appliacation..
but dont know.. how actually should i proceed with this... so need ur help...

any suggestions or advice is most welcome...
thanks in advance...

--------
Regards
Suma

wysota
13th March 2011, 09:20
Please try to rephrase and restructure your question. I can't make out anything of it.

suma
13th March 2011, 09:34
hai..

k lemme make it still more clear..

assume that.. one application(say some main menu screen) is already runing.. and at one point of time.. when user press some thing(when user selects any of the menu item..).. the main menu screen must launch one more application(specific to the menu item...which is my application..).. and must get disappeared... later when user exits from this .. the menu screen must appear again...

i mean to say... when user press some key... the initial running application.. after launching my application.. must disappear and my application must appear infront of the screen directly..

but what is happening is..

the initial running application.. still is getting displayed on the screen even after my application is getting launched... which is making my application to run in the background... i mean.. i am able to see that my application is getting launched.. but it is getting displayed behind the currently running application(main menu screen)..

so i thought my application is not getting focused... and asked u regarding providing the focus at QT level and providing focus to the application directly...

i hope.. i am clear with my point..

wysota
13th March 2011, 09:46
Have you tried just calling QWidget::raise() on your window? Focus has nothing to do with your problem.

suma
13th March 2011, 09:56
if its not the problem of focus.. then wat is that actually denying my application from being displayed directly on the screen.. n y is it runing in the background??...

wysota
13th March 2011, 10:51
Do you show() any of the application's windows? Does the window get displayed if you run the application manually?

suma
13th March 2011, 14:31
s.. i am trying to display the main window of my application.. i mean.. i am calling show() on my main window....

but dint get u.. when u say.. running application manually....
can u plz tell me what do u mean by running application manually???...

since the application is created in QT creator.. iam trying to run it by making..
1. qmake
2. make
3. n then runing my application..