示例#1
0
 def add_header(self, name, row=None):
     if row is None:
         row = self.table.rowCount()
     self.table.insertRow(row)
     named_item = QtGui.QTableWidgetItem(name)
     named_item.setFlags(QtCore.Qt.NoItemFlags)
     header_font = QtGui.QFont()
     header_font.setBold(True)
     named_item.setFont(header_font)
     named_item.setData(QtCore.Qt.UserRole, str(name))
     self.table.setItem(row, 1, named_item)
     separator_text = ""
     item = QtGui.QTableWidgetItem(separator_text)
     item.setFlags(QtCore.Qt.NoItemFlags)
     self.table.setItem(row, 0, item)
     item = QtGui.QTableWidgetItem(separator_text)
     item.setFlags(QtCore.Qt.NoItemFlags)
     self.table.setItem(row, 2, item)
     item = QtGui.QTableWidgetItem(separator_text)
     item.setFlags(QtCore.Qt.NoItemFlags)
     self.table.setItem(row, 3, item)
     item = QtGui.QTableWidgetItem(separator_text)
     item.setFlags(QtCore.Qt.NoItemFlags)
     self.table.setItem(row, 4, item)
     return named_item
    def updateFonts(self):
        f = self.title.font()
        size = int(self.settings.value("plotFontSize"))
        f.setPointSize(size)
        self.title.setFont(f)

        f = QtGui.QFont()
        f.setPointSize(size)
        ax = self.plot.getAxis('left')
        ax.setTickFont(f)
        ax = self.plot.getAxis('bottom')
        ax.setTickFont(f)