Found a solution. re-implement closeEvent(QCloseEvent *event) and have it run event->ignore() every time closeEvent is called.