On Thu Sep 3 22:00:52 BST 2009, Adam W. wrote:

> I have a standard QComboBox displaying about 25 text based items right now,
> left aligned.
> What I want to do is display a bool status for the same items and have it
> right aligned in the child list box (preferably display in the list view
> only too). I haven't determined if the status will be text or an icon yet,
> probably what ever is easier.

There are a few ways to do this. I can think of two just off the top of my
head.

> I've been brainstorming for a while now trying to figure out the best way
> to go about this. I can't seem to extract a list of visible items in the
> combobox's child list with rect's, so I can't draw on top of them.

If you wanted to go that route, you could create your own item delegate and
draw the items yourself.

> I'm still new to Qt, so I don't really have a good grasp of whats possible,
> its likely this is an easy built in feature I haven't found yet. Any
> suggestions would be great.

Probably the easiest place to start is to swap out the view used to display
the combo box's pop-up menu. I've put some sample code up on the PyQt Wiki:

  http://www.diotavelli.net/PyQtWiki/Using_a_different_view_with_QComboBox

It's also linked to from the SampleCode page:

  http://www.diotavelli.net/PyQtWiki/SampleCode

There are limitations with this approach, but it may be just enough to do
what you want.

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

Reply via email to