Results 1 to 3 of 3

Thread: How can i make a QProgreessBar with rounded edges and gradient color background?

  1. #1
    Join Date
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default How can i make a QProgreessBar with rounded edges and gradient color background?

    How can i make a QProgreessBar with rounded edges and gradient color background green-yellow-orange-red? ( I'm using QT4.3 embedded linux )

    I'm trying with stylesheet. Gradient works perfectly, but rounded edges no.

    the code is this:

    bar.setStyleSheet( "QProgressBar::chunk:vertical { background: QLinearGradient(x1: 0.5, y1: 1, x2: 0.5, y2: 0, stop: 0 #4bfd05, stop: 0.35 #fdee05, stop: 0.75 #fd9d05, stop: 1 #fd051c); border: 1px transparent; border-radius: 8px; color: transparent}");


    what's wrong??


    Thanks

  2. #2
    Join Date
    Dec 2008
    Location
    France
    Posts
    93
    Thanked 23 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: How can i make a QProgreessBar with rounded edges and gradient color background?

    It works for me with with adding :
    Qt Code:
    1. border: 1px transparent;
    2. border-radius: 8px;
    3. color: transparent
    4. }
    To copy to clipboard, switch view to plain text mode 
    to your styleSheet string.

  3. #3
    Join Date
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How can i make a QProgreessBar with rounded edges and gradient color background?

    It works! Another problem was the parent widget size was less.

    Thanks

Similar Threads

  1. Transparent background and rounded edges
    By adrianoleal in forum Newbie
    Replies: 0
    Last Post: 13th April 2011, 21:14
  2. To make rounded Line edit( with out using mask )
    By ashishsaryar in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2010, 13:26
  3. Widget with rounded edges
    By gruszczy in forum Qt Programming
    Replies: 14
    Last Post: 26th April 2009, 08:03
  4. rounded edges in qmainwindow
    By m.wojcik in forum Qt Programming
    Replies: 5
    Last Post: 11th March 2009, 14:12
  5. gradient background
    By drkbkr in forum Qt Programming
    Replies: 4
    Last Post: 30th March 2006, 17:10

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.