'Set the QSplitter and QWidget instance the resizer should control.
.. note:: the widget must be in the splitter.'

def setSplitterAndWidget(self, splitter, widget):

    if (splitter and widget and (not (splitter.indexOf(widget) > 0))):
        raise ValueError('Widget    must    be    in    a    spliter.')
    if (self.__widget is not None):
        self.__widget.removeEventFilter(self)
    if (self.__splitter is not None):
        self.__splitter.removeEventFilter(self)
    self.__splitter = splitter
    self.__widget = widget
    if (widget is not None):
        widget.installEventFilter(self)
    if (splitter is not None):
        splitter.installEventFilter(self)
    self.__update()
    size = self.size()
    if (self.__expanded and (size == 0)):
        self.open()
    elif ((not self.__expanded) and (size > 0)):
        self.close()
