Results 1 to 7 of 7

Thread: widget not able to recieve the focus...plz help me..

  1. #1
    Join Date
    Nov 2010
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default widget not able to recieve the focus...plz help me..

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: widget not able to recieve the focus...plz help me..

    Please try to rephrase and restructure your question. I can't make out anything of it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2010
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: widget not able to recieve the focus...plz help me..

    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..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: widget not able to recieve the focus...plz help me..

    Have you tried just calling QWidget::raise() on your window? Focus has nothing to do with your problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2010
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: widget not able to recieve the focus...plz help me..

    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??...

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: widget not able to recieve the focus...plz help me..

    Do you show() any of the application's windows? Does the window get displayed if you run the application manually?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2010
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: widget not able to recieve the focus...plz help me..

    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..

Similar Threads

  1. Replies: 2
    Last Post: 7th July 2010, 14:49
  2. widget focus ---------
    By jrodway in forum Qt Programming
    Replies: 11
    Last Post: 27th April 2009, 09:16
  3. Widget Focus
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2008, 10:22
  4. QTableWidget does not recieve events from cell
    By yuval-ca in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2008, 17:32
  5. QFtp->List() does not recieve any data
    By nopalot in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2006, 20:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.