Редакция 74 | Редакция 76 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 74 | Редакция 75 | ||
---|---|---|---|
Строка 241... | Строка 241... | ||
241 | ui->tableView_2->setItemDelegateForColumn(3, &classTableDelegate); |
241 | ui->tableView_2->setItemDelegateForColumn(3, &classTableDelegate); |
242 | 242 | ||
243 | currIndexOfClassesTable = mymodel->index(0, 1); |
243 | currIndexOfClassesTable = mymodel->index(0, 1); |
244 | QModelIndex index_temp;
|
244 | QModelIndex index_temp;
|
245 | 245 | ||
- | 246 | ||
- | 247 | ||
246 | currClassID = mymodel->data(mymodel->index(0,0)).toString(); |
248 | currClassID = mymodel->data(mymodel->index(0,0)).toString(); |
247 | QItemSelectionModel *selectionModel = ui->tableView->selectionModel(); |
249 | QItemSelectionModel *selectionModel = ui->tableView->selectionModel(); |
248 | 250 | ||
249 | QModelIndex topLeft;
|
251 | QModelIndex topLeft;
|
250 | QModelIndex bottomRight;
|
252 | QModelIndex bottomRight;
|
Строка 258... | Строка 260... | ||
258 | 260 | ||
259 | QString class_indx, class_instance;
|
261 | QString class_indx, class_instance;
|
260 | QString str_fltr = tr("ClassIdentifer = "); |
262 | QString str_fltr = tr("ClassIdentifer = "); |
261 | class_indx = mymodel->data(mymodel->index(0,0)).toString(); |
263 | class_indx = mymodel->data(mymodel->index(0,0)).toString(); |
262 | class_instance = mymodel->data(mymodel->index(0,3)).toString(); |
264 | class_instance = mymodel->data(mymodel->index(0,3)).toString(); |
- | 265 | ||
- | 266 | currInctanceTable = class_instance; // |
|
- | 267 | modelForDescription->setInctance(class_instance); // ïåðåäàåì â ìîäåëü ïîëåé èìÿ òåêóùåé òàáëèöû-õðàíèëèùà |
|
263 | //class_instance.append(tr("_inctance"));
|
268 | //class_instance.append(tr("_inctance"));
|
264 | str_fltr.append(class_indx); |
269 | str_fltr.append(class_indx); |
265 | 270 | ||
266 | model->setTable(class_instance); |
271 | model->setTable(class_instance); |
267 | //model->setTable(tr("memory"));
|
272 | //model->setTable(tr("memory"));
|
Строка 488... | Строка 493... | ||
488 | QString tmp_str, filter_str, instance_str;
|
493 | QString tmp_str, filter_str, instance_str;
|
489 | index_tmp = ui->tableView->model()->index(row, 0); |
494 | index_tmp = ui->tableView->model()->index(row, 0); |
490 | index_instance = ui->tableView->model()->index(row, 3); |
495 | index_instance = ui->tableView->model()->index(row, 3); |
491 | tmp_str = ui->tableView->model()->data(index_tmp).toString(); |
496 | tmp_str = ui->tableView->model()->data(index_tmp).toString(); |
492 | instance_str = ui->tableView->model()->data(index_instance).toString(); |
497 | instance_str = ui->tableView->model()->data(index_instance).toString(); |
- | 498 | modelForDescription->setInctance(instance_str); // ïåðåäàåì â ìîäåëü ïîëåé èìÿ òåêóùåé òàáëèöû-õðàíèëèùà |
|
- | 499 | ||
- | 500 | ||
- | 501 | ||
- | 502 | ||
493 | // instance_str.append(tr("_inctance"));
|
503 | // instance_str.append(tr("_inctance"));
|
494 | /*
|
504 | /*
|
495 | Inctance_model.clear();
|
505 | Inctance_model.clear();
|
496 | Inctance_model.setTable(instance_str);
|
506 | Inctance_model.setTable(instance_str);
|
497 | Inctance_model.select();
|
507 | Inctance_model.select();
|
Строка 644... | Строка 654... | ||
644 | ClassEditor::modelForDescription->removeRows(0, row); |
654 | ClassEditor::modelForDescription->removeRows(0, row); |
645 | ClassEditor::modelForDescription->submitAll(); |
655 | ClassEditor::modelForDescription->submitAll(); |
646 | }
|
656 | }
|
647 | 657 | ||
648 | void ClassEditor::on_myModel_dataChanged( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ |
658 | void ClassEditor::on_myModel_dataChanged( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ |
- | 659 | ||
649 | int i; |
660 | int i; |
650 | i++; |
661 | i++; |
651 | ui->tableView->resizeColumnsToContents(); |
662 | ui->tableView->resizeColumnsToContents(); |
- | 663 | ||
- | 664 | ||
- | 665 | ||
- | 666 | ||
- | 667 | ||
652 | }
|
668 | }
|
653 | 669 | ||
654 | void ClassEditor::on_modelForDescription_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ |
670 | void ClassEditor::on_modelForDescription_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ |
655 | ui->tableView_2->resizeColumnsToContents(); |
671 | ui->tableView_2->resizeColumnsToContents(); |
- | 672 | ||
- | 673 | /*
|
|
- | 674 | QString instance_str;
|
|
- | 675 | instance_str = mymodel->data(mymodel->index(ClassEditor::currIndexOfClassesTable.row(), 3)).toString();
|
|
- | 676 | tableForInstance->close();
|
|
- | 677 | delete model;
|
|
- | 678 | delete tableForInstance;
|
|
- | 679 | model = new QSqlTableModel();
|
|
- | 680 | tableForInstance = new QTableView();
|
|
- | 681 | model->setTable(instance_str);
|
|
- | 682 | model->setEditStrategy(QSqlTableModel::OnManualSubmit);
|
|
- | 683 | tableForInstance->setModel(model);
|
|
- | 684 | ||
- | 685 | model->select();
|
|
- | 686 | tableForInstance->setWindowTitle(instance_str);
|
|
- | 687 | tableForInstance->show();
|
|
- | 688 | */
|
|
656 | }
|
689 | }
|
657 | 690 | ||
658 | void ClassEditor::on_action_ID_triggered(bool is_checked){ // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ID" |
691 | void ClassEditor::on_action_ID_triggered(bool is_checked){ // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ID" |
659 | if (is_checked) ui->tableView->showColumn(0); |
692 | if (is_checked) ui->tableView->showColumn(0); |
660 | else ui->tableView->hideColumn(0); |
693 | else ui->tableView->hideColumn(0); |