code: def restore_boolean_setting(self, key, check_box):
          
          flag = setting(key, expected_type=bool, qsettings=self.settings)
          check_box.setChecked(flag)
docs: Set check_box according to setting of key.
  
          :param key: Key to retrieve setting value.
          :type key: str
  
          :param check_box: Check box to show and set the setting.
          :type check_box: PyQt5.QtWidgets.QCheckBox.QCheckBox