SOLVED: Hide frame when button is clicked()

I created a MainWindow and placed a QFrame on it. Then placed a button on top of the frame. I connected the 2 objects so that the frame is supposed to hide when the button is clicked but I get no response. Below is the code for mainwindow.cpp, the rest of the files are the default for a MainWindow project.