You shouldn't be using both a delegate and the cell widget feature. They both aren't meant to work together, as like you said, the widget is drawn on top of whatever is being painted in the cell. Either you use a delegate with a QAbstractItemView or subclasses, or you are using the special feature of the high level QListWidget that let's you set widgets into it. So you should pick one or the other.
If you are going with the delegate, you have full control with the paint method to draw your text yourself at the position that makes sense for the rest of your custom look. If you go with the compound widget in each item, I am sure you already can get that looking the way you want. You may never hit this problem if you aren't showing enough items, but you are more likely to encounter performance issues with the set widget approach first, than the delegate, since each widget has its own events to maintain. Just a difference between them if you care to know why one would choose either approach. On 14/09/2014 7:30 PM, "Bay" <[email protected]> wrote: > Hi Justin, > sorry to have to bother you again. A problem I'm having > with using the qlistwidgetitem is that the text tend to get obscured by the > selection frame drawn (since the text is set to > align (QtCore.Qt.AlignBottom | QtCore.Qt.AlignHCenter)). Now, it was > possible to give a more customized look by creating a Qwidget with 2 labels > to hold the thumbnails and text and using setItemWidget but it seems that > the QStyledItemDelegate only draws over the QListWidgetItem but not the > custom Widget set into it (Feels like the custom widget is set atop of the > QListWIdgetItem). I could use setstylesheet to individually control the > behavior of the 2 labels in the custom widget together with the > itemdelegate but it seems rather inefficient to do it that way. I was > wondering if there might be a flag or command that I'm missing, thanks > again for any assistance rendered :) > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/3cef5d44-a3e5-4dd1-89ce-a587b096a658%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/3cef5d44-a3e5-4dd1-89ce-a587b096a658%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA04w-mPKjuDQ3HFYAEQ5G6NO4zuo4b6uFBwDVLBJto%3DGg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
