Results 1 to 8 of 8

Thread: don't work qlineargradient for text in QLabel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    53
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default don't work qlineargradient for text in QLabel

    i tried everything. in QtDesigner, gradient for QLabel works perfectly, but when i setting style sheet like this :
    "* {color: qlineargradient(spreadad, x1:0 y1:0, x2:1 y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));"

    dynamically in my code, i have a white text on my label
    what am i do wrong?

    here, how i do this:

    Qt Code:
    1. mpExampleLabel = new QLabel(tr("Cell text example"), this);
    2. mpExampleLabel->setFrameStyle(QFrame::Box);
    3. mpExampleLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    4. mpExampleLabel->setStyleSheet("* {color: qlineargradient(spread:pad, x1:0 y1:0, x2:1 y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));");
    To copy to clipboard, switch view to plain text mode 
    Last edited by GreenScape; 27th July 2010 at 00:00.

Similar Threads

  1. QLabel setPixmap doesnt work
    By arpspatel in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2010, 22:24
  2. How to right-justify QLabel text
    By JimDaniel in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2008, 08:55
  3. Squeeze text in QLabel
    By jiveaxe in forum Qt Programming
    Replies: 5
    Last Post: 6th September 2007, 10:45
  4. background-image on QLabel does NOT work
    By VireX in forum Newbie
    Replies: 2
    Last Post: 8th June 2007, 20:30
  5. Getting QLabel to work with WinAPI GetWindowText?
    By m.parker in forum Qt Programming
    Replies: 3
    Last Post: 22nd December 2006, 21:22

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
  •  
Qt is a trademark of The Qt Company.