Results 1 to 5 of 5

Thread: Tab border higllights when tab key is use to switch between tabs in qTabWidget

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

    Default Tab border higllights when tab key is use to switch between tabs in qTabWidget

    I have added about 7 tabs in a QTabWidget using the addTab(...) function.

    1). When I use tab key to navigate through the tabs i.e. tab key to get focus to tab, and then left and right arrow keys to switch through the tabs, the border highlights of the pane or tab highlights. Is there a way to not have this effect?

    2). I am also allowing the the scroll button if the window size is small. Hitting tab key after the one of the tab takes focus, the focus goes to this scroll button instead of the tab-page widget. Is there a way to specify the order?

    I have tried setTabOrder function but it doesn't work. Can anyone help?

  2. #2
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Tab border higllights when tab key is use to switch between tabs in qTabWidget

    If you don't want to use tabbing for your tabs (if that makes sense), set their focus policy to "none". Otherwise you need to research how to turn off the focus rectangle -- can be done but how varies based on Qt version, et al.

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

    Default Re: Tab border higllights when tab key is use to switch between tabs in qTabWidget

    I need to have tabbing functionality, but thanks for the reply. Just a quick question, do you know how to not let the scroll arrow buttons take focus?

  4. #4
    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: Tab border higllights when tab key is use to switch between tabs in qTabWidget

    What I understand from your explanation is that your tab order is working as expected. Could you post a simple sketch of the widget, if possible.

    Things are not very clear, do you have tab widget in the scroll area? or each (or one of the) tab page has scroll bar ?

    I think you need to review / rethink both the widget hierarchy, and tab ordering, adjusting them slightly should achieve what you want.

  5. #5
    Join Date
    Jun 2011
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tab border higllights when tab key is use to switch between tabs in qTabWidget

    No i do not have any widget in any scroll area, but what I am talking is in the following picture.

    Scroll.jpgfocusRect.jpg

    Here is the problem: If i set the QTabWidget focus policy to NoFocus then it works fine, but cannot use tab key + arrow keys to move focus between tabs.

    If i set it to tabfocus or strongfocus then I can use tab + arrow key to move focus between tabs, but the white line as displayed in second picture comes up.

    This happens with QCDEStyle, but not with QPlastiqueStyle. I need to use QCDEStyle so I am wondering if there is a way to fix this.

    Thanks!

Similar Threads

  1. QTabWidget with same tabs
    By Djony in forum Qt Programming
    Replies: 20
    Last Post: 24th December 2011, 12:20
  2. Adding tabs in a QTabWidget
    By Hogwarts in forum Qt Programming
    Replies: 3
    Last Post: 8th February 2011, 19:40
  3. QTabWidget: Switch tab on drop
    By kghose in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2008, 19:31
  4. QTabWidget - Add Tabs dynamically
    By fruzzo in forum Qt Programming
    Replies: 11
    Last Post: 27th February 2008, 08:26
  5. Switching off all tabs in QTabWidget
    By Gopala Krishna in forum Qt Programming
    Replies: 7
    Last Post: 30th August 2006, 17:10

Tags for this Thread

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.