I had to cheat to make it work the way I wanted.

I added a check in the changeEvent:
Qt Code:
  1. if (strPurged == "True")
  2. close();
To copy to clipboard, switch view to plain text mode 

At the end of the purgeCache function I assign True to strPurged.

I noticed that even though I enter the closeEvent and the window wouldn't close, that a call was made to the changeEvent since closing is a changeEvent.

Although this is a bit hackish it works. If there is a better way please let me know.