[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Multitple icons/pixmap in same cell
From:       David Boddie <david () boddie ! org ! uk>
Date:       2019-09-06 23:48:42
Message-ID: 6620135.cszfCWtBlH () aurora
[Download RAW message or body]

On Fri Sep 6 15:43:52 BST 2019, donoban wrote:

> I am trying to adapt a medium sized pyqt appication to model/view
> architecture (https://github.com/QubesOS/qubes-manager/pull/195)
> 
> I have a problem when trying to imitate the 'State' column behavior. As
> you could see here:
> https://www.linuxjournal.com/sites/default/files/styles/850x500/public/nodei
> mage/story/12011f2.png
> 
> This column can have multiple icons which show the current state of the
> VM. In the internal code it uses a custom widget with a layout and adds
> new widgets with a pixmap and tooltip.

You can still use widgets in QTableView if you want to:

https://doc.qt.io/qt-5/qtableview.html#visual-appearance

> Does anybody know how to imitate this with model/view design? Could I
> split the 'State' column in multiple columns which share the same header
> cell?

While it is possible to make cells span multiple columns, I don't think it's
possible to make headers do that, though I haven't looked at this in a long
time.

You might instead use a single pixmap for the column and draw individual
indicators at different places in the pixmap.

David
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic