Results 1 to 3 of 3

Thread: Problem with push button navigation.

  1. #1
    Join Date
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Problem with push button navigation.

    Dear Friends,

    I am stuck with problem in designing with QT.
    I have created one form and in that form I have total 8 push buttons. Four buttons are in one row and other four buttons are in second row.

    now i want when i m pressing side arrow key it should focus only upper four push buttons.
    and when i press down arrow key it will come in second row and than it will get focused only below four push buttons.

    Please suggest me some solution how to do it?
    I have already created 8 push button, but now i need control of these push buttons.

    Please give me solution, i m stuck in this problem,

    thanks in advance. waiting for your reply...

    Thanks & Regards,
    Keyur Parekh.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Problem with push button navigation.

    Add the first row buttons in a group box, and add the second row buttons in another group box, and handle the down arrow key event for the first group box, and up arrow key event in second group box, left and right arrows should work as you expect once the focus is in the group box.

    Edit: It may not be simple to use this way, you need to alternately disable the group boxes, but I don't thinks this will be a good solution, as you may need to be able to use mouse to click the non active row buttons, so ignore this

    Another simple way, is to set a Qt::StrongFocus on active row buttons, and Qt::NoFocus on non-active buttons, when user presses down / up arrow, capture it some how and exchange change the focus settings.
    Last edited by Santosh Reddy; 17th June 2011 at 08:50. Reason: updated contents

  3. #3
    Join Date
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Problem with push button navigation.

    Hi Santosh,

    thanks for your reply, I have solved the problem . Your suggestion is very helpful to me....thanks once again......

Similar Threads

  1. Problem with push button navigation
    By keyurparekh in forum Qt Programming
    Replies: 10
    Last Post: 19th July 2011, 12:18
  2. Push Button with image?
    By steve.bush in forum Newbie
    Replies: 10
    Last Post: 18th March 2011, 06:48
  3. [QT]Push button-no action
    By nqn in forum Newbie
    Replies: 4
    Last Post: 30th May 2010, 19:08
  4. problem in Displaying image on push button
    By durgarao in forum Qt Tools
    Replies: 4
    Last Post: 2nd January 2009, 10:27
  5. Push Button problem!!
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2006, 16:31

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.