Results 1 to 2 of 2

Thread: QStyleOptionProgressBar customized

  1. #1
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QStyleOptionProgressBar customized

    Hi,

    I'm painting a QProgressBar (using QStyleOptionProgressBar) into a QTreeView and works perfectly, ok, now I want customize this QProgressBar.

    I made an a style sheet which works perfectly with a normal QProgressBar (not delegated), but I don't know how to set this Style Sheet to my delegated QProgressBar, because the QStyleOptionProgressBar don't have the styleSheet property.

    This is the style sheet used to customize the QProgressBar:

    [HTML]QProgressBar:horizontal {
    border: 1px solid gray;
    border-radius: 3px;
    background: white;
    padding: 1px;
    }
    QProgressBar::chunk:horizontal {
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565);
    color: white;
    padding-left: 4px;
    border: 1px solid #6c6c6c;
    }[/HTML]

    Best regards, xEsk.

  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: QStyleOptionProgressBar customized

    From what I know the default delegate in Qt4.3- might not support that feature. You might try applying the stylesheet on the view, but that probably won't work. You might also try applying the stylesheet to the view and using the view's style() to paint the progress bar. If that doesn't work, you'll need to get a snapshot of Qt4.4 with QStyledItemDelegate functionality and there it should work just fine (at least I hope so).

    See the details here:http://labs.trolltech.com/blogs/2007...ng-item-views/

  3. The following user says thank you to wysota for this useful post:

    xEsk (11th November 2007)

Similar Threads

  1. Customized Table
    By tunguska in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2007, 17:44

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.