Indeed, this works. Thank you.
One thing I don't understand is if you replace integers with variables and execute it several times, why does the command still execute only once. For example consider this:
Qt Code:
  1. for(int x=0; x<100; x++)
  2. {
  3. resize(100-x, 100-x);
  4. }
To copy to clipboard, switch view to plain text mode 

Why doesn't this automatically shrink the window. I'm probably asking something very stupid.