Results 1 to 4 of 4

Thread: QTabWidget

  1. #1

    Default QTabWidget

    I've got a QTabWidget control with different tabs for chat conversations, how can I light one up to show there are new messages for that tab. I've tried SetFocus and had a good look around the API with no luck


  2. #2
    Join Date
    Jan 2006
    Thanked 1,005 Times in 913 Posts
    Qt products
    Unix/X11 Windows Symbian S60
    Wiki edits

    Default Re: QTabWidget

    you have to subclass QTabWidget and add that functionality by your own. There is no such feature but a implementation is not that hard. Just try it.

  3. #3

    Default Re: QTabWidget

    Thanks for your reply, once I've made my own custom tab widget as a sub class of QTabWidget what calls do I make to make the actual tab things change colour/state?

  4. #4
    Join Date
    Nov 2009
    Thanked 29 Times in 29 Posts
    Qt products

    Default Re: QTabWidget

    You could assign it a distinctive icon with QTabWidget::setTabIcon.

    If you want to control individual tabs with more options than QTabWidget provides, sub-class it and use QTabWidget::tabBar to get the tab bar widget; that would allow you to change the text color, for example, of individual tabs.

    It looks as if the tab bar itself is one widget, with no provision for changing the background color of individual tabs; so if you want to do that, I think you would have to implement a custom QTabBar::paintEvent using QTabBar::tabRect to figure out which areas need to be painted with a different background, and use QTabWidget::setTabBar to make the tab widget use your custom tab bar.

Similar Threads

  1. QTabWidget problem
    By Strongoloid in forum Newbie
    Replies: 2
    Last Post: 10th September 2009, 20:38
  2. Segment fault using a Qt plugin with QTabWidget
    By tarod in forum Qt Programming
    Replies: 2
    Last Post: 14th July 2009, 10:27
  3. Changing the background of QTabWidget
    By ike in forum Qt Tools
    Replies: 2
    Last Post: 7th November 2008, 13:43
  4. QTabWidget clicking problems after addTab()
    By DonSam in forum Qt Programming
    Replies: 0
    Last Post: 14th October 2008, 08:28
  5. How do I add new tab to QTabWidget
    By pcmantinker in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2008, 04:24


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.