Re-parent the applet.

        This is little more then calling Qt's native ``setParent()``
        method but also updates the ``qteParentWindow`` handle. This
        method is usually called when the applet is added/removed from
        a splitter and thus requires re-parenting.

        |Args|

        * ``parent`` (**QWidget**): the new parent of this object.

        |Returns|

        * **None**

        |Raises|

        * **None**

def qteReparent(self, parent):
        """
        Re-parent the applet.

        This is little more then calling Qt's native ``setParent()``
        method but also updates the ``qteParentWindow`` handle. This
        method is usually called when the applet is added/removed from
        a splitter and thus requires re-parenting.

        |Args|

        * ``parent`` (**QWidget**): the new parent of this object.

        |Returns|

        * **None**

        |Raises|

        * **None**
        """

        # Set the new parent.
        self.setParent(parent)

        # If this parent has a Qtmacs structure then query it for the
        # parent window, otherwise set the parent to None.
        try:
            self._qteAdmin.parentWindow = parent.qteParentWindow()
        except AttributeError:
            self._qteAdmin.parentWindow = None
            # Sanity check:
            if parent:
                msg = 'Parent is neither None, nor does it have a'
                msg += 'qteParentWindow field --> bug'
                print(msg)