plotter/hpgl_qt.py

changeset 35
3b7a38af5c42
parent 32
59da528bc470
child 36
cb4124e3e75b
--- a/plotter/hpgl_qt.py	Sat Jan 26 11:39:30 2008 +0100
+++ b/plotter/hpgl_qt.py	Sun Feb 03 23:39:27 2008 +0100
@@ -24,6 +24,7 @@
         l = QtGui.QVBoxLayout(self)
         l.setMargin(1)
         self.qview = QtGui.QGraphicsView(self)
+        self.qview.setRenderHints(QtGui.QPainter.Antialiasing)
         self.qview.scale(0.5,-0.5)
         l = self.layout()
         l.addWidget(self.qview)
@@ -72,7 +73,12 @@
             
     def SP(self):
         HPGLParser.SP(self)
-        self.qpen.setColor(QtGui.QColor(self.pen_colors[self.pen]))
+        color = self.pen_colors[self.pen]
+        if isinstance(color, tuple):
+            color = QtGui.QColor(*color)
+        else:
+            color = QtGui.QColor(color)
+        self.qpen.setColor(color)
         
     def parse(self, data):
         HPGLParser.parse(self, data)

mercurial