make plotter really repaint itsefl when some property of the plot is changed

Thu, 14 Feb 2008 19:28:10 +0100

author
David Douard <david.douard@logilab.fr>
date
Thu, 14 Feb 2008 19:28:10 +0100
changeset 47
0ebdbcbb7852
parent 46
235686915f92
child 48
ceb2a3a4de6c

make plotter really repaint itsefl when some property of the plot is changed

pygpibtoolkit/HP3562A/datablockwidget.py file | annotate | diff | comparison | revisions
--- a/pygpibtoolkit/HP3562A/datablockwidget.py	Tue Feb 12 19:55:02 2008 +0100
+++ b/pygpibtoolkit/HP3562A/datablockwidget.py	Thu Feb 14 19:28:10 2008 +0100
@@ -8,7 +8,7 @@
 import  state_decoder
 import  trace_decoder
 import  coord_decoder
-from pygpibtoolkit.qt4.mpl import QMplCanvas
+from pygpibtoolkit.qt4.mpl import QMplCanvas, FigureCanvas
 from pygpibtoolkit.HP3562A import mathtools
 
 children = [ ]
@@ -19,7 +19,6 @@
     """
     for child in children:
         if child.isValidDatablock(datablock):
-            print "using" , child
             return child
     return None
 
@@ -65,6 +64,9 @@
             l = QtGui.QVBoxLayout(sarea)
             l.setContentsMargins(0,0,0,0)
             table = QtGui.QTableWidget(sarea)
+            table.setStyleSheet('font-size: 10px;')
+            self.setupRowsHeight(table)
+            table.setShowGrid(False)
             table.setAlternatingRowColors(True)
             table.verticalHeader().hide()
             l.addWidget(table, 1)
@@ -74,7 +76,7 @@
         if table.verticalHeader().minimumSectionSize()>0:
             cellsize = table.verticalHeader().minimumSectionSize()
         else:
-            cellsize = 17
+            cellsize = 15
         table.verticalHeader().setDefaultSectionSize(cellsize)
 
     def updateHeaderData(self):
@@ -124,8 +126,8 @@
                 item_.setText(val)
                 table.setItem(i, 1, item_)
             table.resizeColumnsToContents()
-            table.resizeRowsToContents()
-            # self.setupRowsHeight(self.table)    
+            #table.resizeRowsToContents()
+            #self.setupRowsHeight(self.table)    
         
     def userFriendlyName(self):
         return self.username
@@ -259,8 +261,9 @@
         else:
             msg += 'THD+N:%.2g db  '%thdn
         self.statusBar().showMessage(msg)
-        self.canvas.repaint() 
-
+        self.canvas.draw() 
+        
+        
 class CoordBinaryDatablockMDIChild(TraceBinaryDatablockMDIChild):
     _username = "Coord"
     _header_struct = coord_decoder.TRACE_HEADER, coord_decoder.HEADER,  
@@ -303,7 +306,7 @@
         if self.header[0]['Display function']:
             self.canvas.axes.set_title(self.header[0]['Display function'])
         
-        self.canvas.repaint() 
+        self.canvas.draw() 
         
     
 children.append(CoordBinaryDatablockMDIChild)

mercurial