'Specify the default text formatting for the entire table, or for a
single column if *column* is specified.
If a string is specified, it is used as a format string for converting
float values (and all other types are converted using str). If a
function is specified, it will be called with the item as its only
argument and must return a string. Setting format = None causes the
default formatter to be used instead.
Added in version 0.9.9.'

def setFormat(self, format, column=None):

    if ((format is not None) and (not isinstance(format, basestring)) and (not callable(format))):
        raise ValueError(('Format    argument    must    string,    callable,    or    None.    (got    %s)' % format))
    self._formats[column] = format
    if (column is None):
        for c in range(self.columnCount()):
            if (self._formats.get(c, None) is None):
                for r in range(self.rowCount()):
                    item = self.item(r, c)
                    if (item is None):
                        continue
                    item.setFormat(format)
    else:
        if (format is None):
            format = self._formats[None]
        for r in range(self.rowCount()):
            item = self.item(r, column)
            if (item is None):
                continue
            item.setFormat(format)
