code: def _qteMouseClicked(self, widgetObj):
          
  
          # ------------------------------------------------------------
          # The following cases for widgetObj have to be distinguished:
          #   1: not part of the Qtmacs widget hierarchy
          #   2: part of the Qtmacs widget hierarchy but not registered
          #   3: registered with Qtmacs and an applet
          #   4: registered with Qtmacs and anything but an applet
          # ------------------------------------------------------------
  
          # Case 1: return immediately if widgetObj is not part of the
          # Qtmacs widget hierarchy; otherwise, declare the applet
          # containing the widgetObj active.
          app = qteGetAppletFromWidget(widgetObj)
          if app is None:
              return
          else:
              self._qteActiveApplet = app
  
          # Case 2: unregistered widgets are activated immediately.
          if not hasattr(widgetObj, '_qteAdmin'):
              self._qteActiveApplet.qteMakeWidgetActive(widgetObj)
          else:
              if app._qteAdmin.isQtmacsApplet:
                  # Case 3: widgetObj is a QtmacsApplet instance; do not
                  # focus any of its widgets as the focus manager will
                  # take care of it.
                  self._qteActiveApplet.qteMakeWidgetActive(None)
              else:
                  # Case 4: widgetObj was registered with qteAddWidget
                  # and can thus be focused directly.
                  self._qteActiveApplet.qteMakeWidgetActive(widgetObj)
  
          # Trigger the focus manager.
          self._qteFocusManager()
docs: Update the Qtmacs internal focus state as the result of a mouse click.
  
          |Args|
  
          * ``new`` (**QWidget**): the widget that received the focus.
  
          |Returns|
  
          * **None**
  
          |Raises|
  
          * **None**