Form1::Form1():QMainWindow(NULL,0)

It should be like this.....
ui(new Ui::QtMySql)