def drawPath(self, path): """ Store a path command in the command list :param QPainterPath path: Painter path .. seealso:: :py:meth:`QPaintEngine.drawPath()` """ painter = self.paintEngine().painter() if painter is None: return self.__data.commands += [QwtPainterCommand(path)] if not path.isEmpty(): scaledPath = painter.transform().map(path) pointRect = scaledPath.boundingRect() boundingRect = QRectF(pointRect) if painter.pen().style() != Qt.NoPen\ and painter.pen().brush().style() != Qt.NoBrush: boundingRect = qwtStrokedPathRect(painter, path) self.updateControlPointRect(pointRect) self.updateBoundingRect(boundingRect) self.__data.pathInfos += [ PathInfo(pointRect, boundingRect, qwtHasScalablePen(painter)) ]
def drawImage(self, rect, image, subRect, flags): painter = self.paintEngine().painter() if painter is None: return self.__data.commands += [QwtPainterCommand(rect, image, subRect, flags)] r = painter.transform().mapRect(rect) self.updateControlPointRect(r) self.updateBoundingRect(r)
def updateState(self, state): """ Store a state command in the command list :param QPaintEngineState state: State to be stored .. seealso:: :py:meth:`QPaintEngine.updateState()` """ #XXX: shall we call the parent's implementation of updateState? self.__data.commands += [QwtPainterCommand(state)]
def drawPixmap(self, rect, pixmap, subRect): """ Store a pixmap command in the command list :param QRectF rect: target rectangle :param QPixmap pixmap: Pixmap to be painted :param QRectF subRect: Reactangle of the pixmap to be painted .. seealso:: :py:meth:`QPaintEngine.drawPixmap()` """ painter = self.paintEngine().painter() if painter is None: return self.__data.commands += [QwtPainterCommand(rect, pixmap, subRect)] r = painter.transform().mapRect(rect) self.updateControlPointRect(r) self.updateBoundingRect(r)
def drawImage(self, rect, image, subRect, flags): """ Store a image command in the command list :param QRectF rect: target rectangle :param QImage image: Pixmap to be painted :param QRectF subRect: Reactangle of the pixmap to be painted :param Qt.ImageConversionFlags flags: Pixmap to be painted .. seealso:: :py:meth:`QPaintEngine.drawImage()` """ painter = self.paintEngine().painter() if painter is None: return self.__data.commands += [ QwtPainterCommand(rect, image, subRect, flags) ] r = painter.transform().mapRect(rect) self.updateControlPointRect(r) self.updateBoundingRect(r)
def updateState(self, state): #XXX: shall we call the parent's implementation of updateState? self.__data.commands += [QwtPainterCommand(state)]