Calling
testButton->show();
at the end solved this problem. Since using adjustSize() on the frame without show() on the actual button made the frame disappear, I think that maybe widgets are hidden until explicitly shown when added in like this.