Hi,
I am trying to draw a simple busy indicator into a QCombobox while it's
being populated with items.
I thought I'd use with a custom paint event that checks is a certain
condition is true, and if so it will draw custom stuff in to the menu,
otherwise it just does it's default thing and draw the items as usual.
This is the bit I started with:
class TaskWidget(QtWidgets.QComboBox):
def __init__(self, parent=None):
super(TaskWidget, self).__init__(parent)
def paintEvent(self, event):
super(TaskWidget, self).paintEvent(event)
painter = QtGui.QPainter()
painter.begin(self)
indicator = QtCore.QRect(0,0,5, event.rect().height())
painter.fillRect(indicator, QtCore.Qt.red)
painter.end()
which yields this:
How do I get the (rounded) rectangle of the menu itself though? I.e. I
only want to draw the red bar inside the menu area that will show the items.
I guess I should try to query the item view's rect via it's item
delegate or something, but I can't get it right.
Any help would be appreciated.
Happy Christmas!
Cheers,
frank
_______________________________________________
PySide mailing list
[email protected]
https://lists.qt-project.org/listinfo/pyside