Results 1 to 11 of 11

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

    Hi friends

    I have made one screen in Qt.

    In my first screen there are four push buttons are there. Now i have apply focus in event on that. So when ever i press tab key it get focused.

    but now i want is that when my focus reach to last button and than again if i press tab key it should come again to first push button. It comes after 4 to 5 times pressing of tab key.

    so how can i restrict that navigation? Please suggests me with some source code how can i do that?

    Please help me to solve this problem.

  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: Problem with push button navigation

    Did you set the tab order for your widgets in Designer/Creator? Do all of your buttons accept focus?
    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
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Problem with push button navigation

    Hi,

    thanks for your suggestion. I have tried to set tab order as mention below... Please check it is it perfect or not? I have four push button whose pointers are

    pushButton, pushButton_2,pushButton_3 , pushButton_4. So i have set tab order.


    pushButton->setTabOrder(pushButton,pushButton_2);
    pushButton_2->setTabOrder(pushButton_2,pushButton_3);
    pushButton_3->setTabOrder(pushButton_3,pushButton_4);
    pushButton_4->setTabOrder(pushButton_4,pushButton);

    But still is not working as i wanted it to work. When focus is on last push button and i press tab it comes over 1st button. but when i press tab again it takes 5 to 6 tabs to go on to next push button. Please tell me some solutions for this...

    Thanks in advance.
    waiting for your reply...

  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: Problem with push button navigation

    Where is the focus during those "5 to 6 tabs"?
    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
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Problem with push button navigation

    Hi,

    thanks for your reply.
    But what you asking I am not clear about it?
    am i missing any syntex which need to be written ?
    Please tell me what to do?

    I am stuck with this problem...

  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: Problem with push button navigation

    When you press the tab key it causes focus to move to the next widget. So I'm asking where does the focus move to during the action you described here:
    but when i press tab again it takes 5 to 6 tabs to go on to next push button.
    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
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Problem with push button navigation

    Hi

    I have four push buttons. I have set tab order of all four of them.

    setTabOrder(pushButton,pushButton_2);
    setTabOrder(pushButton_2,pushButton_3);
    setTabOrder(pushButton_3,pushButton_4);
    setTabOrder(pushButton_4,pushButton);

    When i press tab first it selects fist push button, but when i press tab focus just disappears.
    And after pressing 4 to 5 tabs it selects second push button. Than if i press tab again it directly selects push button 3 and so on. But between first and second push button it takes more tabs. Can you please tell why these happen.

    One more thing i want to tell. I have one form on that i have take stack widget and on that its graphics view and after that i have put push buttons.

    So because of these problem occurs or what?

    Please reply me.

  8. #8
    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: Problem with push button navigation

    Quote Originally Posted by keyurparekh View Post
    When i press tab first it selects fist push button, but when i press tab focus just disappears.
    It doesn't dissapear. It moves to another widget. It might not be one of the push buttons you have. In doubt check QApplication::focusWidget().
    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.


  9. #9
    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
    thanks so much for your support.
    I have solve the problem......
    once again thanks so much........

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

    I have attach one png file here. I want to create screen like in that image. how can i create menus

  11. #11
    Join Date
    Jun 2011
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with push button navigation

    hi ,

    Please try this :
    u have any widget other than push button like(graphic view)?
    If u have widget other than push button than go every widget in .ui file and set no focus property in the property of that particular widgets.
    all the push button has strong focus property..

    kinjal.

Similar Threads

  1. Bitmap on Push Button in QT 3
    By Gokulnath in forum Newbie
    Replies: 2
    Last Post: 12th January 2011, 07:34
  2. [QT]Push button-no action
    By nqn in forum Newbie
    Replies: 4
    Last Post: 30th May 2010, 19:08
  3. A very small push button
    By Gnurou in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2009, 03:04
  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.