title: Adjusting QMainWindow size
body: <p>I am currently building a minesweeper game which has three different game modes. Harder mode has more objects and a bigger window size. When I try to switch back to a simpler mode, the size of the window will not resize to a smaller window, which will make the layout look terrible. </p>
  
  <p>Before it looks like this:<br><a href="https://i.stack.imgur.com/0yYVV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0yYVV.png" alt="enter image description here"></a></p>
  
  <p>After switching from a harder mode, the layout will be like this(which remains the size of the harder mode):<br><a href="https://i.stack.imgur.com/QsG36.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QsG36.png" alt="enter image description here"></a></p>
  
  <p>So what can I do to set those windows to suitable sizes? Or what can I do to set a default window size for each mode? <br>Thanks</p>