actTableView = new QTableView(this);model = new QSqlRelationalTableModel;model->setEditStrategy(QSqlTableModel::OnManualSubmit);model->setTable("mediko_economic_certificate");model->setFilter("act_id = "+QVariant(++*actId).toString()+" AND is_deleted=0");model->select();model->setRelation(14, QSqlRelation("infringement_main_point_list","infrigement_point","infrigement_point"));actTableView->setModel(model);actTableView->setSelectionBehavior(QAbstractItemView::SelectRows);actTableView->show();actTableView->setItemDelegate(new QSqlRelationalDelegate(actTableView));
query.exec("CREATE OR REPLACE VIEW имя_представления AS запрос");