def METHOD_NAME(self):
    """
    Saves and returns the state of the custom widgets. The visibility of the
    docks is not saved since it is included in `QMainWindow.saveState`.
    """
    state = []
    for btn, act, w, grp in self.otherWidgets:
        state.append(
            (grp, btn.text(), btn.isChecked())
        )
    return state