Adjust the widget size inside the splitter according to ``handlePos``.

        See ``pos`` argument in _qteSplitterMovedEvent for a more detailed
        explanation.

        If ``handlePos`` is **None**, then the widgets are assigne equal size.

        |Args|

        * ``handlePos`` (**int**): splitter position relative to the origin.

        |Returns|

        * **None**

        |Raises|

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

def qteAdjustWidgetSizes(self, handlePos: int=None):
        """
        Adjust the widget size inside the splitter according to ``handlePos``.

        See ``pos`` argument in _qteSplitterMovedEvent for a more detailed
        explanation.

        If ``handlePos`` is **None**, then the widgets are assigne equal size.

        |Args|

        * ``handlePos`` (**int**): splitter position relative to the origin.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # Do not adjust anything if there are less than two widgets.
        if self.count() < 2:
            return
        
        if self.orientation() == QtCore.Qt.Horizontal:
            totDim = self.size().width() - self.handleWidth()
        else:
            totDim = self.size().height() - self.handleWidth()

        # Assign both widgets the same size if no handle position provided.
        if handlePos is None:
            handlePos = (totDim + self.handleWidth()) // 2

        # Sanity check.
        if not (0 <= handlePos <= totDim):
            return

        # Compute widget sizes according to handle position.
        newSize = [handlePos, totDim - handlePos]

        # Assign the widget sizes.
        self.setSizes(newSize)