Results 1 to 3 of 3

Thread: how to display batter power meter

  1. #1
    Join Date
    Oct 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to display batter power meter

    I need to display a battery power meter using QT 4.3. Using the QProgressBar or QPainter to draw a rectangle and fill it according to the current battery level are the two solutions I've thought of.

    Are there simpler ways to display a battery power meter image?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to display batter power meter

    You can subclass QWidget and override paintEvent. In there you can do custom painting like gradients, images and other more complex drawing to make your meter look good.

  3. #3
    Join Date
    Jul 2007
    Posts
    26
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: how to display batter power meter

    You would set up a max point to a progressbar, I don't know, let's say 100 for 100% and then supply the current battery value with QProgressBar::value().
    Looking for lots of help with my project.

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.