Overloaded ``show()`` function to avoid calling it
        accidentally.

        This method is a (weak) security mechanism to prevent
        programmers from using the ``show`` method as originally
        intended by Qt, ie. to show a window. In Qtmacs, applets can
        only be made visible with either ``qteMakeAppletActive`` or by
        replacing another window in the layout with eg
        ``qteReplaceWindowInLayout``. Using the Qt native ``show()``
        method messes with the Qtmacs layout engine and can lead to
        unexpected visual results and more serious errors.

        This method should only be used by ``QtmacsMain`` to implement
        the layout but not by any applets or macros, unless it is for
        a widget not under the control of Qtmacs (probably a bad
        idea).

        The user should call the ``qteNewApplet`` method to create and
        show a applet.

        |Args|

        * ``fromQtmacs`` (**bool**): if **True** then the original
          ``show()`` method is called

        |Returns|

        * **None**

        |Raises|

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

def show(self, fromQtmacs: bool=False):
        """
        Overloaded ``show()`` function to avoid calling it
        accidentally.

        This method is a (weak) security mechanism to prevent
        programmers from using the ``show`` method as originally
        intended by Qt, ie. to show a window. In Qtmacs, applets can
        only be made visible with either ``qteMakeAppletActive`` or by
        replacing another window in the layout with eg
        ``qteReplaceWindowInLayout``. Using the Qt native ``show()``
        method messes with the Qtmacs layout engine and can lead to
        unexpected visual results and more serious errors.

        This method should only be used by ``QtmacsMain`` to implement
        the layout but not by any applets or macros, unless it is for
        a widget not under the control of Qtmacs (probably a bad
        idea).

        The user should call the ``qteNewApplet`` method to create and
        show a applet.

        |Args|

        * ``fromQtmacs`` (**bool**): if **True** then the original
          ``show()`` method is called

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        if not fromQtmacs:
            # Log a warning message if someone tries to call the
            # native show() method.
            msg = 'show() command for applet <b>{}</b> ignored. '
            msg += ' Use qteNewApplet instead.'.format(self.qteAppletID())
            self.qteLogger.warning(msg)
        else:
            # Sanity check: the parent of this applet *must* be a
            # ``QtmacsLayoutSplitter`` as otherwise it cannot be
            # shown.
            sig_ = self.parent()._qteAdmin.widgetSignature
            if sig_ != '__QtmacsLayoutSplitter__':
                msg = 'show() command for applet <b>{}</b> ignored'
                msg = msg.format(self.qteAppletID())
                msg += ' because its parent is not a '
                msg += 'QtmacsLayoutSplitter --> Bug.'
                return

            # Before the applet is actually shown update the
            # ``parentWindow`` reference in the admin structure. To
            # obtain this reference, query the parent of this very
            # applet (which is a QtmacsSplitter instance) for its
            # parent window since both must necessarily be shown in
            # the same window and thus have the same parent window.
            self._qteAdmin.parentWindow = self.parent().qteParentWindow()

            # Update the Qtmacs internal visibility flag (used in the
            # focus manager to ensure that Qt and Qtmacs agree on
            # which applets are visible and which are not) and then
            # tell Qt to make the applet visible once the event loop
            # regains control.
            self._qteAdmin.isVisible = True
            QtGui.QWidget.show(self)