def add_rect_to_scene(self, rect, brush=QtGui.QBrush(), pen=QtGui.QPen(Qt.yellow, 4, Qt.DashLine)): """Adds rect to scene, returns GUQGraphicsRectItem - for interactive stuff""" from graphqt.GUQGraphicsRectItem import GUQGraphicsRectItem pen.setCosmetic(True) item = GUQGraphicsRectItem(rect, parent=None, scene=self.scene()) item.setPen(pen) item.setBrush(brush) return item
def add_rect_to_scene(self, rect, brush=QtGui.QBrush(), pen=QtGui.QPen(Qt.yellow, 4, Qt.DashLine)): from graphqt.GUQGraphicsRectItem import GUQGraphicsRectItem #pen.setCosmetic(True) #return self.scene().addRect(rect, pen, brush) pen.setCosmetic(True) #item = QtGui.QGraphicsRectItem(rect, parent=None, scene=self.scene()) item = GUQGraphicsRectItem(rect, parent=None, scene=self.scene()) item.setPen(pen) item.setBrush(brush) #self.scene().addRect(item) #item.setAcceptsHoverEvents(True) return item