void DialogNewColumn::on_pushButton_2_clicked(){ QSqlQuery query; QString table = tables->currentText(); QString nameColumn = ui->tableView->model()->data(ui->tableView->currentIndex()).toString(); qDebug() << ui->tableView->model()->data(ui->tableView->currentIndex()); QString str = "ALTER TABLE \"" + table + "\" DROP COLUMN \"" + nameColumn + "\" ";; query.exec(str);}
QModelIndex string = ui->tableView->currentIndex().row(); model->removeRows(string, 1);
C++ (Qt)int row = ui->tableView->currentIndex().row();model->removeRow(row);