Results 1 to 3 of 3

Thread: How to install text color of an QLabel?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question How to install text color of an QLabel?

    On the standard form there is an QLabel with the text, would like to make at form loading text color of an the QLabel red, and after a file choice - green. Has tried:
    Qt Code:
    1. QPalette t_palette = ui->lbFileName->palette();
    2. t_palette.setColor(QPalette::Text, Qt::gray);
    3. ui->lbFileName->setPalette(t_palette);
    To copy to clipboard, switch view to plain text mode 
    Color doesn't change. Prompt, please, as it to make.
    Attached Files Attached Files

Similar Threads

  1. Replies: 3
    Last Post: 22nd January 2010, 16:46
  2. Replies: 1
    Last Post: 31st August 2009, 07:44
  3. QPushbutton + QLabel text color
    By Ashish in forum Qt Programming
    Replies: 5
    Last Post: 3rd February 2007, 08:13
  4. Setting text color on QLabel
    By Yorma in forum Newbie
    Replies: 11
    Last Post: 15th June 2006, 07:25
  5. QLabel background color
    By munna in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 15:36

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.