Results 1 to 3 of 3

Thread: How to paint with QLinearGradient in QLabel?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: How to paint with QLinearGradient in QLabel?

    Assuming you are trying to produce some sort of custom widget then you should sub-class QLabel, reimplement QWidget::paintEvent() and do your painting there. See the Analogue Clock Example.

    You may be able to achieve a similar result using style sheets, particularly the background property

  2. The following user says thank you to ChrisW67 for this useful post:

    programmer251 (2nd May 2012)

Similar Threads

  1. Replies: 0
    Last Post: 8th September 2011, 07:53
  2. don't work qlineargradient for text in QLabel
    By GreenScape in forum Qt Programming
    Replies: 7
    Last Post: 29th July 2010, 16:59
  3. Replies: 1
    Last Post: 29th September 2009, 19:44
  4. Regarding qlineargradient
    By jjbabu in forum Qt Programming
    Replies: 6
    Last Post: 15th April 2009, 09:21
  5. QLinearGradient question
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 7th March 2008, 16:52

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.