def drawLines(self, lines, lineCount=None): if lineCount is None: lineCount = len(lines) device = self.nullDevice() if device is None: return if device.mode() != QwtNullPaintDevice.NormalMode: try: QPaintEngine.drawLines(lines, lineCount) except TypeError: # PyQt <=4.9 QPaintEngine.drawLines(self, lines) return device.drawLines(lines, lineCount)