Results 1 to 9 of 9

Thread: setfocus working?

  1. #1
    Join Date
    Jan 2006
    Posts
    80
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default setfocus working?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: setfocus working?

    Em...why you don want use TAB ?

    p.s. sorry man but are you dont take solution from your previous thread
    Last edited by zlatko; 9th March 2006 at 10:01.
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Posts
    80
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: setfocus working?

    Quote Originally Posted by zlatko
    Em...why you don want use TAB ?

    p.s. sorry man but are you dont take solution from your previous thread
    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

  4. #4
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: setfocus working?

    have you catch specified key pressed?
    a life without programming is like an empty bottle

  5. #5
    Join Date
    Jan 2006
    Posts
    80
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: setfocus working?

    Quote Originally Posted by zlatko
    have you catch specified key pressed?

    yes...

    mahe2310

  6. #6
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: setfocus working?

    put next code in your handler
    Qt Code:
    1. if ( listBox->hasFocus())
    2. pushButton->setFocus();
    To copy to clipboard, switch view to plain text mode 
    a life without programming is like an empty bottle

  7. #7
    Join Date
    Jan 2006
    Posts
    80
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: setfocus working?

    Quote Originally Posted by zlatko
    put next code in your handler
    Qt Code:
    1. if ( listBox->hasFocus())
    2. pushButton->setFocus();
    To copy to clipboard, switch view to plain text mode 

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

    Mahe2310

  8. #8
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: setfocus working?

    You need call this code there where you catch your arrow pressed
    a life without programming is like an empty bottle

  9. #9
    Join Date
    Jan 2006
    Posts
    80
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: setfocus working?

    Quote Originally Posted by zlatko
    You need call this code there where you catch your arrow pressed

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

Similar Threads

  1. QResource Stopped Working
    By JPNaude in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 12:26
  2. QDevelop and CTags -> Not working
    By philwinder in forum Qt-based Software
    Replies: 13
    Last Post: 9th May 2008, 21:40
  3. Don't want QTextBrowser to look in working directory
    By magland in forum Qt Programming
    Replies: 1
    Last Post: 20th October 2007, 23:14
  4. GUI thread and Working thread comunication
    By FasTTo in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2007, 15:31
  5. Signals/Slots stopped working
    By Jimmy2775 in forum Qt Programming
    Replies: 8
    Last Post: 31st March 2006, 21:11

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.