In the constructor of MainWindow, you create a new QCustomPlot like this:
customPlot = new QCustomPlot(this);
and then don't set any geometry. This is why it's at the top left of the main window. Where else should it be?
I see that on your ui file you have created a second QCustomPlot called "widget", but in your code you never use it. Maybe you are confusing these two instances and you didn't actually want to create a new QCustomPlot instance in the MainWindow constructor? In that case, use
ui->widget instead of
customPlot in the
MainWindow::on_pushButton_7_clicked method. (You might also want to rename "widget" to something more sensible, such as "plot", same with your other components on the ui file).