code: def set_window_settings(self, hexstate, window_size, prefs_dialog_size,
                              pos, is_maximized, is_fullscreen):
          
          self.setUpdatesEnabled(False)
          self.window_size = QSize(window_size[0], window_size[1]) # width,height
          self.prefs_dialog_size = QSize(prefs_dialog_size[0],
                                         prefs_dialog_size[1]) # width,height
          self.window_position = QPoint(pos[0], pos[1]) # x,y
          self.setWindowState(Qt.WindowNoState)
          self.resize(self.window_size)
          self.move(self.window_position)
  
          # Window layout
          if hexstate:
              self.restoreState( QByteArray().fromHex(
                      str(hexstate).encode('utf-8')) )
              # [Workaround for Issue 880]
              # QDockWidget objects are not painted if restored as floating
              # windows, so we must dock them before showing the mainwindow.
              for widget in self.children():
                  if isinstance(widget, QDockWidget) and widget.isFloating():
                      self.floating_dockwidgets.append(widget)
                      widget.setFloating(False)
  
          # Is fullscreen?
          if is_fullscreen:
              self.setWindowState(Qt.WindowFullScreen)
          self.__update_fullscreen_action()
  
          # Is maximized?
          if is_fullscreen:
              self.maximized_flag = is_maximized
          elif is_maximized:
              self.setWindowState(Qt.WindowMaximized)
          self.setUpdatesEnabled(True)
docs: Set window settings
          Symetric to the 'get_window_settings' accessor