[PyQt] Multitple icons/pixmap in same cell

donoban donoban at riseup.net
Sat Sep 7 16:04:44 BST 2019


On 9/7/19 2:55 AM, Maurizio Berti wrote:
> Using multiple columns with a "shared" header cell is possible, but not
> easy.
> ...
> I've decided for a more "standard" approach which simply puts all icons
> left aligned, but since you've cited tooltips I also added support for
> those.
> The idea is that you use a role for each icon you want to show, given
> that a "status" icon is always visible, and any other icon is shown
> whenever exists and its role is set to True.
> I use QStyle and QStyleItemView to draw the base item rectangle, then
> find the rectangle where an icon would be shown and use that data to
> paint all icons.
> 

Thanks. I will try to implement this way, the left alignment should be fine.


More information about the PyQt mailing list