(self, index, widget, title)
Insert `widget` with `title` at `index`.

        Parameters
        ----------
        index : int
            Position at which the widget should be inserted.
        widget : QWidget
            Widget instance.
        title : str
            Widget title.
Insert `widget` with `title` at `index`.
Insert widget with title at index .
def insertWidget(self, index, widget, title):
        """Insert `widget` with `title` at `index`.

        Parameters
        ----------
        index : int
            Position at which the widget should be inserted.
        widget : QWidget
            Widget instance.
        title : str
            Widget title.
        """
        # TODO: Check if widget is already inserted.
        frame = SequenceFlow.Frame(widget=widget, title=title)
        frame.closeRequested.connect(self.__closeRequested)

        layout = self.__flowlayout

        frames = [item.widget() for item in self.layout_iter(layout)
                  if item.widget()]

        if 0 < index < len(frames):
            # find the layout index of a widget occupying the current
            # index'th slot.
            insert_index = layout.indexOf(frames[index])
        elif index == 0:
            insert_index = 0
        elif index < 0 or index >= len(frames):
            insert_index = layout.count()
        else:
            assert False

        layout.insertWidget(insert_index, frame)

        frame.installEventFilter(self)
def insertWidget ( self , index , widget , title ) : # TODO: Check if widget is already inserted. frame = SequenceFlow . Frame ( widget = widget , title = title ) frame . closeRequested . connect ( self . __closeRequested ) layout = self . __flowlayout frames = [ item . widget ( ) for item in self . layout_iter ( layout ) if item . widget ( ) ] if 0 < index < len ( frames ) : # find the layout index of a widget occupying the current # index'th slot. insert_index = layout . indexOf ( frames [ index ] ) elif index == 0 : insert_index = 0 elif index < 0 or index >= len ( frames ) : insert_index = layout . count ( ) else : assert False layout . insertWidget ( insert_index , frame ) frame . installEventFilter ( self )