Results 1 to 5 of 5

Thread: Height by value on a Custom Progress Bar ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2017
    Posts
    18
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Height by value on a Custom Progress Bar ?

    Qt Code:
    1. int heightValue = (int)qRound(((float)currentValue / maxProgressBarValue) * heightOfTheProgressBar);
    To copy to clipboard, switch view to plain text mode 

    And I draw with QPainter a rectangle like that:
    Qt Code:
    1. painter.drawRect(0, 0, 100, heightValue);
    To copy to clipboard, switch view to plain text mode 
    Last edited by MathFurious; 8th February 2018 at 14:35. Reason: updated contents

Similar Threads

  1. Custom Progress Dialog while loading QTreeWidget
    By m3rlin in forum Qt Programming
    Replies: 5
    Last Post: 4th March 2013, 05:13
  2. Custom progress bar background for list items
    By themagician in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2012, 22:07
  3. How to set custom height for ListView & ComboBox items
    By rawfool in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2011, 10:39
  4. ListWidget -> custom Item -> height
    By Archa4 in forum Newbie
    Replies: 5
    Last Post: 4th February 2011, 11:36
  5. Replies: 4
    Last Post: 11th March 2008, 11:44

Tags for this Thread

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.