irrad_control/gui/widgets/util_widgets.py
def _add_item(self, item):
        """Actually adds widgets to grid layout"""

        try:
            n_widgets = len(item)
        except TypeError:
            n_widgets = 1

        if n_widgets == 1:
            # Catch edge case in which we get an iterable with only one widget e.g. item=[QLabel]
            try:
                item = item[0]
            except TypeError:
                pass
            self._add_to_grid(item, self.cnt_row, 0)
        else:
            # Loop over all widgets and add to layout
            for i, itm in enumerate(item):
                self._add_to_grid(itm, self.cnt_row, i)

        # Update
        self.cnt_col[self.cnt_row] = n_widgets
        self.cnt_row += 1
Actually adds widgets to grid layout
Actually adds widgets to grid layout
Actually adds widgets to grid layout
def _add_item(self, item):
        try:
            n_widgets = len(item)
        except TypeError:
            n_widgets = 1
        if n_widgets == 1:
            try:
                item = item[0]
            except TypeError:
                pass
            self._add_to_grid(item, self.cnt_row, 0)
        else:
            for i, itm in enumerate(item):
                self._add_to_grid(itm, self.cnt_row, i)
        self.cnt_col[self.cnt_row] = n_widgets
        self.cnt_row += 1
def _add_item ( self , item ) : try : n_widgets = len ( item ) except TypeError : n_widgets = 1 if n_widgets == 1 : try : item = item [ 0 ] except TypeError : pass self . _add_to_grid ( item , self . cnt_row , 0 ) else : for i , itm in enumerate ( item ) : self . _add_to_grid ( itm , self . cnt_row , i ) self . cnt_col [ self . cnt_row ] = n_widgets self . cnt_row += 1
Actually adds widgets to grid layout
Actually adds widgets to grid layout
"""Actually adds widgets to grid layout""" # Catch edge case in which we get an iterable with only one widget e.g. item=[QLabel] # Loop over all widgets and add to layout # Update
self
item