Results 1 to 9 of 9

Thread: PixelMetric for QProgressBar gutter/margin spacing?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question PixelMetric for QProgressBar gutter/margin spacing?

    I have a subclass of QProgressBar that draws its own progress bar groove and contents by overriding paintEvent(), but I've noticed that the height of the bar is apparently supposed to change depending on the graphical theme in use at the time. For example, it looks fine when I test in Linux, but note the difference in height between the top bar and the bottom bars in this Windows Classic theme screenshot:



    The top is the native QProgressBar. I want to duplicate that appearance. How do I get the correct vertical "gutter" spacing for the active style so that I can draw the bar at the correct distance from the borders of the groove?

    EDIT: I think what I'm looking for is a PixelMetric from the active style, but I'm not sure which one. The only one that seems to be specific to progress bars is QStyle::PM_ProgressBarChunkWidth, but that's obviously not what I need. Any ideas?

    --Colin
    Attached Images Attached Images
    Last edited by cmb; 1st March 2014 at 20:08. Reason: updated contents

Similar Threads

  1. Replies: 1
    Last Post: 11th July 2012, 12:47
  2. drawing triangle with gradient based on vertices
    By marc2050 in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2011, 12:45
  3. Replies: 3
    Last Post: 11th December 2009, 17:13
  4. QprogressBar Style Sheets: double linear gradient
    By Beppe in forum Qt Programming
    Replies: 6
    Last Post: 8th May 2009, 14:41
  5. Custom Style based on Cleanlooks
    By Tux-Slack in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 10:22

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.