Reveal ``applet`` by splitting the space occupied by the
        current applet.

        If ``applet`` is already visible then the method does
        nothing. Furthermore, this method does not change the focus,
        ie. the currently active applet will remain active.

        If ``applet`` is **None** then the next invisible applet
        will be shown. If ``windowObj`` is **None** then the
        currently active window will be used.

        The ``applet`` parameter can either be an instance of
        ``QtmacsApplet`` or a string denoting an applet ID. In the
        latter case the ``qteGetAppletHandle`` method is used to fetch
        the respective applet instance.

        |Args|

        * ``applet`` (**QtmacsApplet**, **str**): the applet to reveal.
        * ``splitHoriz`` (**bool**): whether to split horizontally
          or vertically.
        * ``windowObj`` (**QtmacsWindow**): the window in which to
          reveal ``applet``.

        |Returns|

        * **bool**: if **True**, ``applet`` was revealed.

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.

def qteSplitApplet(self, applet: (QtmacsApplet, str)=None,
                       splitHoriz: bool=True,
                       windowObj: QtmacsWindow=None):
        """
        Reveal ``applet`` by splitting the space occupied by the
        current applet.

        If ``applet`` is already visible then the method does
        nothing. Furthermore, this method does not change the focus,
        ie. the currently active applet will remain active.

        If ``applet`` is **None** then the next invisible applet
        will be shown. If ``windowObj`` is **None** then the
        currently active window will be used.

        The ``applet`` parameter can either be an instance of
        ``QtmacsApplet`` or a string denoting an applet ID. In the
        latter case the ``qteGetAppletHandle`` method is used to fetch
        the respective applet instance.

        |Args|

        * ``applet`` (**QtmacsApplet**, **str**): the applet to reveal.
        * ``splitHoriz`` (**bool**): whether to split horizontally
          or vertically.
        * ``windowObj`` (**QtmacsWindow**): the window in which to
          reveal ``applet``.

        |Returns|

        * **bool**: if **True**, ``applet`` was revealed.

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # If ``newAppObj`` was specified by its ID (ie. a string) then
        # fetch the associated ``QtmacsApplet`` instance. If
        # ``newAppObj`` is already an instance of ``QtmacsApplet``
        # then use it directly.
        if isinstance(applet, str):
            newAppObj = self.qteGetAppletHandle(applet)
        else:
            newAppObj = applet

        # Use the currently active window if none was specified.
        if windowObj is None:
            windowObj = self.qteActiveWindow()
            if windowObj is None:
                msg = 'Cannot determine the currently active window.'
                self.qteLogger.error(msg, stack_info=True)
                return

        # Convert ``splitHoriz`` to the respective Qt constant.
        if splitHoriz:
            splitOrientation = QtCore.Qt.Horizontal
        else:
            splitOrientation = QtCore.Qt.Vertical

        if newAppObj is None:
            # If no new applet was specified use the next available
            # invisible applet.
            newAppObj = self.qteNextApplet(skipVisible=True,
                                           skipInvisible=False)
        else:
            # Do nothing if the new applet is already visible.
            if newAppObj.qteIsVisible():
                return False

        # If we still have not found an applet then there are no
        # invisible applets left to show. Therefore, splitting makes
        # no sense.
        if newAppObj is None:
            self.qteLogger.warning('All applets are already visible.')
            return False

        # If the root splitter is empty then add the new applet and
        # return immediately.
        if windowObj.qteAppletSplitter.count() == 0:
            windowObj.qteAppletSplitter.qteAddWidget(newAppObj)
            windowObj.qteAppletSplitter.setOrientation(splitOrientation)
            return True

        # ------------------------------------------------------------
        # The root splitter contains at least one widget, if we got
        # this far.
        # ------------------------------------------------------------

        # Shorthand to last active applet in the current window. Query
        # this applet with qteNextApplet method because
        # self._qteActiveApplet may be a mini applet, and we are only
        # interested in genuine applets.
        curApp = self.qteNextApplet(numSkip=0, windowObj=windowObj)

        # Get a reference to the splitter in which the currently
        # active applet lives. This may be the root splitter, or one
        # of its child splitters.
        split = self._qteFindAppletInSplitter(
            curApp, windowObj.qteAppletSplitter)
        if split is None:
            msg = 'Active applet <b>{}</b> not in the layout.'
            msg = msg.format(curApp.qteAppletID())
            self.qteLogger.error(msg, stack_info=True)
            return False

        # If 'curApp' lives in the root splitter, and the root
        # splitter contains only a single element, then simply add the
        # new applet as the second element and return.
        if split is windowObj.qteAppletSplitter:
            if split.count() == 1:
                split.qteAddWidget(newAppObj)
                split.setOrientation(splitOrientation)
                return True

        # ------------------------------------------------------------
        # The splitter (root or not) contains two widgets, if we got
        # this far.
        # ------------------------------------------------------------

        # Determine the index of the applet inside the splitter.
        curAppIdx = split.indexOf(curApp)

        # Create a new splitter and populate it with 'curApp' and the
        # previously invisible ``newAppObj``. Then insert this new splitter at
        # the position where the old applet was taken from. Note: widgets are
        # inserted with ``qteAddWidget`` (because they are ``QtmacsApplet``
        # instances), whereas splitters are added with ``insertWidget``, NOT
        # ``qteInsertWidget``. The reason is that splitters do not require the
        # extra TLC necessary for applets in terms of how and where to show
        # them.
        newSplit = QtmacsSplitter(splitOrientation, windowObj)
        curApp.setParent(None)
        newSplit.qteAddWidget(curApp)
        newSplit.qteAddWidget(newAppObj)
        split.insertWidget(curAppIdx, newSplit)

        # Adjust the size of two widgets in ``split`` (ie. ``newSplit`` and
        # whatever other widget) to take up equal space. The same adjusment is
        # made for ``newSplit``, but there the ``qteAddWidget`` methods have
        # already taken care of it.
        split.qteAdjustWidgetSizes()
        return True