示例#1
0
文件: complex.py 项目: StyXman/satyr
    def headerData (self, section, direction, role=Qt.DisplayRole):
        if direction==Qt.Horizontal and role==Qt.DisplayRole:
            data= QVariant (self.headers[section])
        elif direction==Qt.Vertical:
            if role==Qt.SizeHintRole:
                # TODO: support bold fonts
                # again, hacky. 5 for enough witdh for 5 digits
                size= self.fontMetrics.size (Qt.TextSingleLine, "M"*5)
                data= QVariant (size)
            elif role==Qt.TextAlignmentRole:
                data= QVariant (Qt.AlignRight|Qt.AlignVCenter)
            else:
                data= QAbstractTableModel.headerData (self, section, direction, role)
        else:
            data= QAbstractTableModel.headerData (self, section, direction, role)

        return data
示例#2
0
 def headerData (self, col , orientation, role = QtCore.Qt.DisplayRole):
     
     if col >= self.cCount and orientation==QtCore.Qt.Horizontal:
         return QVariant();
     if role == QtCore.Qt.ForegroundRole and orientation==QtCore.Qt.Horizontal and self.restApi == 'liststockdayinfo':
         if  col == self.columnNames.index('growth_ratio') or \
             col == self.columnNames.index('turnover_ratio') or \
             col == self.columnNames.index('amplitude_ratio') or \
             col == self.columnNames.index('volume_ratio') or \
             col == self.columnNames.index('avg_price') or \
             col == self.columnNames.index('total_money') or \
             col == self.columnNames.index('stockid') or \
             col == self.columnNames.index('created'):
                 return QVariant(QtGui.QColor(255,0,0));
     if(role==QtCore.Qt.DisplayRole and orientation==QtCore.Qt.Horizontal) :
         return QVariant(self.headers[col]);  
     return QAbstractTableModel.headerData(self, col,orientation,role)
示例#3
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         return self.colnames_pretty[section]
     return QAbstractTableModel.headerData(self, section, orientation, role)
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         return CatalogAcquisition.COLUMNS[section].name
     return QAbstractTableModel.headerData(self, section, orientation, role)
示例#5
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         return CatalogAcquisition.COLUMNS[section].name
     return QAbstractTableModel.headerData(self, section, orientation, role)
示例#6
0
 def headerData (self, col , orientation, role):
     if(role==QtCore.Qt.DisplayRole and orientation==QtCore.Qt.Horizontal) :
         return self.headers[col];  
     return QAbstractTableModel.headerData(self, col,orientation,role)
示例#7
0
 def headerData(self, col, orientation, role):
     if (role == QtCore.Qt.DisplayRole
             and orientation == QtCore.Qt.Horizontal):
         return self.headers[col]
     return QAbstractTableModel.headerData(self, col, orientation, role)
示例#8
0
 def headerData(self, col, orientation, role):
     if orientation == Qt.Horizontal and role == Qt.DisplayRole:
         logger.debug("--logHeadersData() " + str(self.logHeaders[col]))
         return self.logHeaders[col]
     return QAbstractTableModel.headerData(self, col, orientation, role)
示例#9
0
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         return self.header_labels[section]
     return QAbstractTableModel.headerData(self, section, orientation, role)
示例#10
0
 def headerData(self, section, orientation, role):
     if role == Qt.DisplayRole and orientation == Qt.Horizontal:
         return QVariant(self.columns_names[section])
     else:
         return QAbstractTableModel.headerData(self, section, orientation, role)