C++ (Qt) ui->setupUi(this); createConnection(); m = new QSqlTableModel(this); m->setTable("Table"); m->select(); ui->dohodView->setModel(m); show(); ui->dohodView->resizeRowsToContents(); connect(ui->pushButton_3, SIGNAL(clicked()), SLOT(click()));