'Return the QStandardItem for the widget.'

def item_for_widget(self, widget):

    if isinstance(widget, str):
        widget = self.widget(widget)
    cat = self.category(widget.category)
    cat_ind = self.categories().index(cat)
    cat_item = self.model().item(cat_ind)
    widget_ind = self.widgets(cat).index(widget)
    return cat_item.child(widget_ind)
