# HG changeset patch # User David Douard # Date 1203013690 -3600 # Node ID 0ebdbcbb78526dd0c822f2d7b6e8586f95f2d7ef # Parent 235686915f923bf1b7f5ba9e4173f51cf71478fa make plotter really repaint itsefl when some property of the plot is changed diff -r 235686915f92 -r 0ebdbcbb7852 pygpibtoolkit/HP3562A/datablockwidget.py --- 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)