Your table view is created on the stack. As soon as the variable goes out of scpe - here: your constructor has finished - it is destroyed. Use a pointer and heap allocation:
@
QTableView *tableView = new QTableView(this);
tableView->setModel(model);
@
Also, make sure to make the view the central widget or add it to a layout.