On 3/20/2020 3:46 PM, John Weeks wrote:
Alot of QStyle code seems to think that all drawing will be done in a widget 
solely occupied by whatever it is that QStyle is drawing.

Drawing should be done starting at the given QStyleOption.rect.topLeft(). I don't think any of the drawing methods assume pos(0, 0) (if they do that does sound like a bug). Am I missing something?

I finally did this for QStyleProgressBar:
        QStyleOptionProgressBar options;
                painter->translate(r.left, r.top);
                options.rect.moveTo(0,0);

Assuming "r" is QStyleOptionViewItem.rect (if we're still talking about item views/delegates), why not just set QStyleOptionProgressBar.rect to the same coordinates? What is options.rect.topLeft() before the move?

-Max
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to