Results 1 to 5 of 5

Thread: progress bar look like battery

  1. #1
    Join Date
    Mar 2011
    Posts
    120
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default progress bar look like battery

    Hi everyone,
    I want to create a battery icon and where i can show the battery percentage.So i want to change the style sheet of progress bar so that it looks like a battery.
    Can any one help me how to create a style sheet for progress bar so that it looks like a battery
    or is there any better way for this one ?

    thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: progress bar look like battery

    I think it's easier to subclass QProgressBar and implement what you want there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2011
    Posts
    120
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: progress bar look like battery

    Do you have any example which will help me ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: progress bar look like battery

    There are lots of examples available. You can have a look at the Analog Clock example in the docs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: progress bar look like battery

    Dis you try this from documentation

    Qt Code:
    1. QProgressBar::chunk {
    2. background-color: #CD96CD;
    3. width: 10px;
    4. margin: 0.5px;
    5. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to use progress bar
    By Ashwani in forum Newbie
    Replies: 6
    Last Post: 10th September 2010, 15:19
  2. Marquee progress bar?
    By daviddoria in forum Newbie
    Replies: 2
    Last Post: 13th February 2010, 02:20
  3. progress bar issues
    By shooogun in forum Qt Programming
    Replies: 4
    Last Post: 14th March 2008, 04:57
  4. Replies: 4
    Last Post: 11th March 2008, 11:44
  5. Reg - Progress bar
    By suresh in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2006, 15:11

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.