'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.'

def insertWidget(self, index, widget, title):

    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)):
        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)
