Хранилища Subversion OpenInventory

Редакция

Редакция 72 | Редакция 74 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 72 Редакция 73
Строка 286... Строка 286...
286
connect(ui->action_showAlias, SIGNAL(triggered(bool)), this, SLOT(on_action_showAlias_triggered(bool))); // ïîêàçûâàòü ïñåâäîíèìû
286
connect(ui->action_showAlias, SIGNAL(triggered(bool)), this, SLOT(on_action_showAlias_triggered(bool))); // ïîêàçûâàòü ïñåâäîíèìû
287
connect(ui->action_showInstance, SIGNAL(triggered(bool)), this, SLOT(on_action_showInstance_triggered(bool))); // ïîêàçûâàòü õðàíèëèùà îáúåêòîâ
287
connect(ui->action_showInstance, SIGNAL(triggered(bool)), this, SLOT(on_action_showInstance_triggered(bool))); // ïîêàçûâàòü õðàíèëèùà îáúåêòîâ
288
connect(ui->action_removeSelectedFields, SIGNAL(triggered()), this, SLOT(on_pushButton_4_clicked())); // óäàëèòü âûäåëåííûå ïîëÿ
288
connect(ui->action_removeSelectedFields, SIGNAL(triggered()), this, SLOT(on_pushButton_4_clicked())); // óäàëèòü âûäåëåííûå ïîëÿ
289
connect(ui->action_removeAllFields, SIGNAL(triggered()), this, SLOT(on_pushButton_5_clicked())); // óäàëèòü âñå ïîëÿ
289
connect(ui->action_removeAllFields, SIGNAL(triggered()), this, SLOT(on_pushButton_5_clicked())); // óäàëèòü âñå ïîëÿ
290
connect(ui->action_removeSelectedClasses, SIGNAL(triggered()), this, SLOT(on_pushButton_2_clicked())); // óäàëèòü âûäåëåííûå êëàññû
290
connect(ui->action_removeSelectedClasses, SIGNAL(triggered()), this, SLOT(on_pushButton_2_clicked())); // óäàëèòü âûäåëåííûå êëàññû
291
connect(ui->action_removeAllClasses, SIGNAL(triggered()), this, SLOT(on_action_removeAllClasses())); // óäàëèòü âûäåëåííûå êëàññû
291
connect(ui->action_removeAllClasses, SIGNAL(triggered()), this, SLOT(on_action_removeAllClasses())); // óäàëèòü âñå êëàññû
292
connect(ui->action_newClass, SIGNAL(triggered()), this, SLOT(on_pushButton_clicked())); // óäàëèòü âûäåëåííûå êëàññû
292
connect(ui->action_newClass, SIGNAL(triggered()), this, SLOT(on_pushButton_clicked())); // äîáàâèòü íîâûé êëàññ
-
 
293
connect(ui->action_newField, SIGNAL(triggered()), this, SLOT(on_pushButton_3_clicked())); // äîáàâèòü íîâîå ïîëå
293
}
294
}
294
295
295
296
296
297
297
298
Строка 416... Строка 417...
416
    // QSqlRecord rec = mymodel->record(1);
417
    // QSqlRecord rec = mymodel->record(1);
417
     //bool ok;
418
     //bool ok;
418
     //ok = rec.isEmpty();
419
     //ok = rec.isEmpty();
419
     //QString currientClassID;
420
     //QString currientClassID;
420
     //currientClassID = rec.value(1).toString();
421
     //currientClassID = rec.value(1).toString();
-
 
422
    QString Inctance_str; // èìÿ òàáëèöû-õðàíèëèùà îáúåêòîâ äëÿ âûáðàííîãî êëàññà
-
 
423
    QString query_str = tr("ALTER TABLE ");
421
    QString Inctance_str;
424
    QString db_error;
-
 
425
    QSqlQuery q;
422
    int currRow = ClassEditor::currIndexOfClassesTable.row(); //
426
    int currRow = ClassEditor::currIndexOfClassesTable.row(); //
423
    Inctance_str = mymodel->data(mymodel->index(currRow, 3)).toString();
427
    Inctance_str = mymodel->data(mymodel->index(currRow, 3)).toString();
-
 
428
    query_str.append( Inctance_str);
-
 
429
    query_str.append(tr(" ADD COLUMN `New field` CHAR(10)"));
-
 
430
    bool ok = q.prepare(query_str);
-
 
431
-
 
432
    ok = q.exec();
-
 
433
    if (!ok) {
-
 
434
                                QMessageBox::critical( // Äèàëîã ñ ñîîáùåíèåì îá îøèáêå.
-
 
435
                                                                                this,                      // Ðîäèòåëüñêèé âèäæåò.
-
 
436
                                                                                QObject::tr("Database Error"),   // Çàãîëîâîê.
-
 
437
                                                                                q.lastError().text()); // Òåêñò ñîîáùåíèÿ.
-
 
438
-
 
439
                                                                return; // âûõîäèì íå ïðèìåíÿÿ èçìåíåíèé
-
 
440
-
 
441
                         }
424
442
425
    int row = modelForDescription->rowCount();
443
    int row = modelForDescription->rowCount();
426
    modelForDescription->insertRows(row, 1);
444
    modelForDescription->insertRows(row, 1);
427
    modelForDescription->setData(modelForDescription->index(row, 5), QVariant(currClassID), Qt::EditRole);
445
    modelForDescription->setData(modelForDescription->index(row, 5), QVariant(currClassID), Qt::EditRole);
428
    modelForDescription->setData(modelForDescription->index(row, 4), QVariant(tr("NULL")), Qt::EditRole);
446
    modelForDescription->setData(modelForDescription->index(row, 4), QVariant(tr("NULL")), Qt::EditRole);
429
447
430
    modelForDescription->submitAll();
448
    modelForDescription->submitAll();
-
 
449
-
 
450
    delete model;
-
 
451
    delete tableForInstance;
-
 
452
    model = new QSqlTableModel();
-
 
453
    tableForInstance = new QTableView();
-
 
454
    model->setTable(Inctance_str);
-
 
455
    model->setEditStrategy(QSqlTableModel::OnManualSubmit);
-
 
456
    tableForInstance->setModel(model);
-
 
457
    tableForInstance->setWindowTitle(Inctance_str);
-
 
458
    tableForInstance->show();
431
}
459
}
432
460
433
461
434
462
435
463
Строка 550... Строка 578...
550

578

551
    }
579
    }
552
*/
580
*/
553
    selectedRows.clear();
581
    selectedRows.clear();
554
    foreach (model_index, indexes){ // ñïèñîê âñåõ âûäåëåííûõ ñòðîê
582
    foreach (model_index, indexes){ // ñïèñîê âñåõ âûäåëåííûõ ñòðîê
-
 
583
        if (!selectedRows.contains(model_index.row()) && (model_index.column()==1))  {
555
        if (!selectedRows.contains(model_index.row()) && (model_index.column()==1))  selectedRows.append(model_index.row()); // îñòàâëÿåì â ñïèñêå òîëüêî âûáðàííûå â ïåðâîé êîëîíêå
584
            selectedRows.append(model_index.row()); // îñòàâëÿåì â ñïèñêå òîëüêî âûáðàííûå â ïåðâîé êîëîíêå
556
585
        }
557
    }
586
    }
558
587
559
    qSort(selectedRows.begin(),selectedRows.end(), qGreater<int>()); // ñîðòèðóåì â îáðàòíîì ïîðÿäêå
588
    qSort(selectedRows.begin(),selectedRows.end(), qGreater<int>()); // ñîðòèðóåì â îáðàòíîì ïîðÿäêå
560
589
561
590