I am slightly confused now... I apologize in advance, not an excuse but this is my first time dealing with QGraphicsXXX and have it integrated with the 'normal' widgets..
In the BaseWidget script - filled_round_rect(), it appears that the icon creation is made there and so I added this part in: def filled_round_rect(): ... ... painter.fillPath(rounded_rect, colour) # I added the following line self.pixmapItem = QtGui.QGraphicsPixmapItem(self.type_icon()) if self.ICON: top_right = self.boundingRect().topRight() painter.drawPixmap( top_right.x() - 35, top_right.y() + 5, self.pixmapItem # I replace this with self.type_icon() ) and got the following error... I had thought that it will work, as the BaseWidget is within QGraphicsScene? # TypeError: # 'PySide2.QtGui.QPainter.drawPixmap' called with wrong argument types: # PySide2.QtGui.QPainter.drawPixmap(float, float, PySide2.QtWidgets.QGraphicsPixmapItem) # Supported signatures: # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QPoint, PySide2.QtGui.QPixmap) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QPoint, PySide2.QtGui.QPixmap, PySide2.QtCore.QRect) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QPointF, PySide2.QtGui.QPixmap) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QPointF, PySide2.QtGui.QPixmap, PySide2.QtCore.QRectF) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QRect, PySide2.QtGui.QPixmap) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QRect, PySide2.QtGui.QPixmap, PySide2.QtCore.QRect) # PySide2.QtGui.QPainter.drawPixmap(PySide2.QtCore.QRectF, PySide2.QtGui.QPixmap, PySide2.QtCore.QRectF) # PySide2.QtGui.QPainter.drawPixmap(int, int, PySide2.QtGui.QPixmap) # PySide2.QtGui.QPainter.drawPixmap(int, int, PySide2.QtGui.QPixmap, int, int, int, int) # PySide2.QtGui.QPainter.drawPixmap(int, int, int, int, PySide2.QtGui.QPixmap) # PySide2.QtGui.QPainter.drawPixmap(int, int, int, int, PySide2.QtGui.QPixmap, int, int, int, int) -- 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 python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7d37d380-c1ae-447c-a47d-aacd19976bc0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.