Subversion Repositories OpenInventory

Rev

Rev 119 | Rev 125 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 120
Line 463... Line 463...
463
}
463
}
464
464
465
void MainWindow::on_pushButton_2_clicked(){ // íàæàòèå êíîïêè "Óäàëèòü âûäåëåííûå îáúåêòû"
465
void MainWindow::on_pushButton_2_clicked(){ // íàæàòèå êíîïêè "Óäàëèòü âûäåëåííûå îáúåêòû"
466
int i;
466
int i;
467
i++;
467
i++;
-
 
468
QModelIndex model_index;
-
 
469
QItemSelectionModel *selectionModel = ui->tableView->selectionModel();
-
 
470
QModelIndexList indexes = selectionModel->selectedIndexes();
-
 
471
QList<int> selectedRows;
-
 
472
selectedRows.clear();
-
 
473
foreach (model_index, indexes){ // ñïèñîê âñåõ âûäåëåííûõ ñòðîê
-
 
474
    if (!selectedRows.contains(model_index.row()) && (model_index.column()==1))  selectedRows.append(model_index.row()); // îñòàâëÿåì â ñïèñêå òîëüêî âûáðàííûå â ïåðâîé êîëîíêå
-
 
475
-
 
476
}
-
 
477
qSort(selectedRows.begin(),selectedRows.end(), qGreater<int>()); // ñîðòèðóåì â îáðàòíîì ïîðÿäêå
-
 
478
-
 
479
-
 
480
for (int m =0; m < selectedRows.size(); ++m){
-
 
481
-
 
482
// ClassEditor::removeClass(selectedRows.at(m));
-
 
483
-
 
484
sql_mogel->removeRow(selectedRows.at(m));
-
 
485
-
 
486
}
-
 
487
sql_mogel->submitAll();
-
 
488
getDatabaseData();
468
489
469
}
490
}
470
491
471
492
472
void MainWindow::on_pushButton_3_clicked(){ // íàæàòèå êíîïêè "Ïðèìåíèòü"
493
void MainWindow::on_pushButton_3_clicked(){ // íàæàòèå êíîïêè "Ïðèìåíèòü"