Results 1 to 5 of 5

Thread: Change the text color tab page

  1. #1
    Join Date
    Jan 2006
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Change the text color tab page

    Dear all,


    I tried the following code snippet for changing the text color of tab page but it wouldn't

    work as I hoped.

    QString strText("<font color=#FF0000>some text</font>");

    my_tab->setTabText(strText,0);

    At runtime the page at position zero shows the strText but it doesn't parse the html tag.

    I expect there are some other ways to change the text color of a tab page. If so, Can

    anybody do me a favour ?

    All helps will be greatly appreciated.

    Thanks in advance

    Have a nice day.

  2. #2
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Change the text color tab page

    Try with void QTabBar::setTabTextColor ( int index, const QColor & color ).
    Qt 5.3 Opensource & Creator 3.1.2

  3. #3
    Join Date
    Jan 2006
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Change the text color tab page

    Dear MarkoSan,

    Thanks for your reply.

    As a matter of fact, I am using Qt version 4.0.0 and QTabBar class doesn't have a method which is so-called setTabTextColor.

    Thanks anyway

    Have a nice day

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    52
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Change the text color tab page

    well is it possible for you to move to QT 4.1? Because there you have that method available.

  5. #5
    Join Date
    Feb 2006
    Location
    Enschede, NL, EU
    Posts
    19
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Change the text color tab page

    Well that or subclass QTabBar and override QTabBar:aintLabel()

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 10:49
  2. Lineedit text change signal
    By zgulser in forum Qt Tools
    Replies: 2
    Last Post: 19th January 2009, 14:38
  3. Replies: 8
    Last Post: 15th May 2007, 10:21
  4. How can I put text on each page using QPrinter
    By davit in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2007, 13:23
  5. Can't change the text display of a QTreeview item.
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 2nd June 2006, 02:03

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.