Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 231 → Rev 232

/trunk/ClassEditor/classeditor.cpp
632,6 → 632,12
ui->tableView->resizeRowsToContents();
}
 
 
 
 
 
 
 
void ClassEditor::on_pushButton_3_clicked(){ // îáðàáîò÷èê íàæàòèÿ êíîïêè "Íîâîå ïîëå"
int i;
i++;
881,9 → 887,25
void ClassEditor::removeClass(int class_row){ // ôóíêöèÿ óäàëÿåò êëàññ, íàõîäÿùèéñÿ â ñòðîêå ñ íîìåðîì class_row
QModelIndex index_tmp;
QString tmp_str, filter_str;
QString class_inctance;
index_tmp = ui->tableView->model()->index(class_row, 0);
tmp_str = ui->tableView->model()->data(index_tmp).toString();
currClassID = tmp_str;
index_tmp = ui->tableView->model()->index(class_row, 3);
class_inctance = ui->tableView->model()->data(index_tmp).toString();
 
QSqlQuery q;
QString sql_str;
bool ok;
sql_str = tr("drop table `");
sql_str.append(class_inctance);
sql_str.append(tr("`"));
ok = q.prepare(sql_str);
 
 
 
 
 
// ui->label->setText(QVariant(currIndexOfClassesTable.row()).toString());
filter_str = tr("ClassIdentifer = ");
filter_str.append(tmp_str);
891,6 → 913,17
ClassEditor::on_pushButton_5_clicked(); // ñíà÷àëà óäàëèì âñå ïîëÿ êëàññà
mymodel->removeRow(class_row); // òåïåðü óäàëÿåì ñàì êëàññ
mymodel->submitAll(); // ôèêñèðóåì èçìåíåíèÿ
 
ok = q.exec();// óäàëÿåì õðàíèëèùå îáúåêòîâ êëàññà
if (!ok) {
QMessageBox::critical( // Äèàëîã ñ ñîîáùåíèåì îá îøèáêå.
this, // Ðîäèòåëüñêèé âèäæåò.
QObject::tr("Database Error"), // Çàãîëîâîê.
q.lastError().text()); // Òåêñò ñîîáùåíèÿ.
 
 
}
 
ui->tableView->resizeColumnsToContents();
ui->tableView_2->resizeColumnsToContents();