Пример #1
0
    def set_header(self, header):
        """Reset the model to reflect blk."""
        if header.__class__ not in [BlockHeader, CBlockHeader] or header is None:
            return self.clear()
        self.beginResetModel()
        self.header = BlockHeader.from_header(header)

        field_names = [i[0] for i in self.header.fields]
        for i, field in enumerate(self.header.fields):
            self.setHeaderData(i, Qt.Vertical, field[0])
        self.endResetModel()
Пример #2
0
    def set_header(self, header):
        """Reset the model to reflect blk."""
        if header.__class__ not in [BlockHeader, CBlockHeader
                                    ] or header is None:
            return self.clear()
        self.beginResetModel()
        self.header = BlockHeader.from_header(header)

        field_names = [i[0] for i in self.header.fields]
        for i, field in enumerate(self.header.fields):
            self.setHeaderData(i, Qt.Vertical, field[0])
        self.endResetModel()
Пример #3
0
 def coerce_header(v):
     return BlockHeader.from_header(v)
Пример #4
0
 def coerce_header(v):
     return BlockHeader.from_header(v)