def repaint(self, rect): x1, y1, x2, y2 = rect.getCoords() width = x2 - x1 height = y2 - y1 # redraw the screen from backing pixmap #print "copying pixmap to widget" painter = QPainter(self) rect = QtCore.QRect(x1, y1, width, height) painter.drawPixmap(rect, self.pixmap, rect)
def repaint(self, rect): x1, y1, x2, y2 = rect.getCoords() width = x2 - x1 height = y2 - y1 # redraw the screen from backing pixmap #print "copying pixmap to widget" painter = QPainter(self) rect = QtCore.QRect(x1, y1, width, height) painter.drawPixmap(rect, self.pixmap, rect)
def paintEvent(self, event): """When an area of the window is exposed, we just copy out of the server-side, off-screen pixmap to that area. """ if not self.pixmap: return rect = event.rect() x1, y1, x2, y2 = rect.getCoords() width = x2 - x1 height = y2 - y1 # redraw the screen from backing pixmap painter = QPainter(self) rect = QtCore.QRect(x1, y1, width, height) painter.drawPixmap(rect, self.pixmap, rect)
def paintEvent(self, event): """When an area of the window is exposed, we just copy out of the server-side, off-screen pixmap to that area. """ if not self.pixmap: return rect = event.rect() x1, y1, x2, y2 = rect.getCoords() width = x2 - x1 height = y2 - y1 # redraw the screen from backing pixmap painter = QPainter(self) rect = QtCore.QRect(x1, y1, width, height) painter.drawPixmap(rect, self.pixmap, rect)