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. #4
    Join Date
    Jul 2010
    Posts
    53
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: don't work qlineargradient for text in QLabel

    no, this is just example, i copied style from QtDesigner and loose brace pasting into browser

    as i said, i tried everything, without selector (i. e. without "* {" and "}"), with "QLabel" and "*".

    here, compilable example:

    #include <QApplication>
    #include <QLabel>

    int main(int argc, char *argv[])
    {
    QApplication app(argc,argv);
    QLabel mpExampleLabel("Cell text example");
    mpExampleLabel.setFrameStyle(QFrame::Box);
    mpExampleLabel.setAlignment(Qt::AlignHCenter|Qt::A lignVCenter);
    mpExampleLabel.setStyleSheet("* {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));}");
    mpExampleLabel.show();
    return app.exec();
    }

    i always have a label with white text! (i. e. text color will be always the color of last stop of any gradient). what am i do wrong?
    Last edited by GreenScape; 27th July 2010 at 08:23.

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.