<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, item, header_flag=False, align=None):
 """Add a Cell to the row :param item: An element to add to the Cells can be list or Cell object. :type item: basestring, QString, list, Cell :param header_flag: Flag indicating it the item is a header or not. :type header_flag: bool :param align: Optional alignment qualifier for all cells in the row. :type align: basestring """


        if self._is_stringable(item) or self._is_qstring(item):
            self.cells.append(Cell(item, header=header_flag, align=align))
        elif isinstance(item, Cell):
            self.cells.append(item)
        elif isinstance(item, Image):
            self.cells.append(Cell(item))
        elif isinstance(item, list):
            for i in item:
                self.cells.append(Cell(i, header=header_flag, align=align))
        else:
            raise InvalidMessageItemError(item, item.__class__)