Results 1 to 4 of 4

Thread: Qstring

  1. #1
    Join Date
    May 2012
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qstring

    how to change text color in Qstring......

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qstring

    QString doesn't have a text color, it's just a string, not a widget that has a visual representation.

    For example if you show your string in a QLabel you can change the color using Qt Style Sheets like this:
    Qt Code:
    1. QLabel* w0 = new QLabel("red background and blue text");
    2. w0->setStyleSheet("QLabel { background-color : red; color : blue; }");
    To copy to clipboard, switch view to plain text mode 
    See the documentation for other widgets.

  3. #3
    Join Date
    May 2012
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qstring

    thanks a lot...

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qstring

    For such a task please use QPalette. The Qt style sheets are not developed further and for that they are pure overhead.

  5. The following 2 users say thank you to Lykurg for this useful post:

    amarnath.rb.tc@gmail.com (29th May 2012), Zlatomir (30th May 2012)

Similar Threads

  1. Replies: 3
    Last Post: 13th February 2012, 04:16
  2. Replies: 2
    Last Post: 11th August 2011, 15:42
  3. Replies: 8
    Last Post: 25th November 2010, 11:40
  4. Replies: 4
    Last Post: 1st February 2010, 14:21
  5. Replies: 4
    Last Post: 31st January 2008, 20:44

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.