(self)
return row_data
Calculate the new size of the grid to avoid too many redraws.
Calculate the new size of the grid to avoid too many redraws.
Calculate the new size of the grid to avoid too many redraws .
def _generateLayoutData(self):
        """Calculate the new size of the grid to avoid too many redraws."""
        padding = self.spacing()
        max_width = self.contentsWidth()
        row_data = [0]
        current_width = -padding
        for item in self._itemOrder:
            item_data = self._itemList[item]
            current_width += item_data['width'] + padding
            if current_width > max_width:
                row_data.append(1)
                current_width = item_data['width']
            else:
                row_data[-1] += 1
        return row_data
def _generateLayoutData ( self ) : padding = self . spacing ( ) max_width = self . contentsWidth ( ) row_data = [ 0 ] current_width = - padding for item in self . _itemOrder : item_data = self . _itemList [ item ] current_width += item_data [ 'width' ] + padding if current_width > max_width : row_data . append ( 1 ) current_width = item_data [ 'width' ] else : row_data [ - 1 ] += 1 return row_data