Subversion Repositories OpenInventory

Rev

Rev 222 | Rev 224 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 222 Rev 223
Line 82... Line 82...
82
82
83
83
84
    getDatabaseData();
84
    getDatabaseData();
85
    //// sql_mogel = new QSqlTableModel();
85
    //// sql_mogel = new QSqlTableModel();
86
    sql_mogel = new MyModel();
86
    sql_mogel = new MyModel();
-
 
87
87
    filter_model = new MyModel();
88
    /// filter_model = new MyModel();
-
 
89
    filter_model = new QSqlTableModel();
88
90
89
91
90
    model_is_build = true;
92
    model_is_build = true;
91
    connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex)));
93
    connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex)));
92
    connect(model_for_ListModelsTable, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_model_for_ListModelsTable_dataChanged(QModelIndex,QModelIndex)));
94
    connect(model_for_ListModelsTable, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_model_for_ListModelsTable_dataChanged(QModelIndex,QModelIndex)));
Line 862... Line 864...
862
        ui->pushButton_12->setEnabled(false);
864
        ui->pushButton_12->setEnabled(false);
863
     //   ui->tableView->reset();
865
     //   ui->tableView->reset();
864
     //   MainWindow::filtr_model->clear();
866
     //   MainWindow::filtr_model->clear();
865
          disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
867
          disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
866
        delete filter_model;
868
        delete filter_model;
-
 
869
867
          filter_model = new QSqlTableModel();
870
        filter_model = new QSqlTableModel();
-
 
871
       /// filter_model = new MyModel();
-
 
872
868
            connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
873
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
869
        int index;
874
        int index;
870
        classesID_list = class_list_map.keys();
875
        classesID_list = class_list_map.keys();
871
        classesNameList = class_list_map.values();
876
        classesNameList = class_list_map.values();
872
        if (item->childCount()>0) index = classesID_list.indexOf(item->child(0)->text(1)); // åñëè ìîäåëü íå ïóñòàÿ, óçíàåì êîðíåâîé êëàññ
877
        if (item->childCount()>0) index = classesID_list.indexOf(item->child(0)->text(1)); // åñëè ìîäåëü íå ïóñòàÿ, óçíàåì êîðíåâîé êëàññ
873
        else { // åñëè ïóñòàÿ
878
        else { // åñëè ïóñòàÿ
Line 901... Line 906...
901
        filtr_str.append(class_id);
906
        filtr_str.append(class_id);
902
       // filtr_str.append(tr("`"));
907
       // filtr_str.append(tr("`"));
903
908
904
        disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
909
        disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
905
        delete filter_model;
910
        delete filter_model;
906
//        filtr_model = new MyModel();
911
  ///      filter_model = new MyModel();
907
912
908
        filter_model = new QSqlTableModel();
913
        filter_model = new QSqlTableModel();
909
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
914
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
910
        filter_model->setTable(tr("Filters"));
915
        filter_model->setTable(tr("Filters"));
911
        filter_model->setFilter(filtr_str);
916
        filter_model->setFilter(filtr_str);
Line 956... Line 961...
956
    model_for_ListModelsTable->setEditStrategy(QSqlTableModel::OnManualSubmit);
961
    model_for_ListModelsTable->setEditStrategy(QSqlTableModel::OnManualSubmit);
957
    ui->tableView_2->setModel(model_for_ListModelsTable);
962
    ui->tableView_2->setModel(model_for_ListModelsTable);
958
963
959
    model_for_ListModelsTable->select();
964
    model_for_ListModelsTable->select();
960
965
961
/*
966
962
    ui->treeWidget->hideColumn(1);
967
    ui->treeWidget->hideColumn(1);
963
    ui->treeWidget->hideColumn(2);
968
    ui->treeWidget->hideColumn(2);
964
    ui->treeWidget->hideColumn(3);
969
    ui->treeWidget->hideColumn(3);
965
    ui->treeWidget->hideColumn(4);
970
    ui->treeWidget->hideColumn(4);
966
//    ui->treeWidget->hideColumn(5);
971
//    ui->treeWidget->hideColumn(5);
967
    ui->treeWidget->hideColumn(6);
972
    ui->treeWidget->hideColumn(6);
968
*/
973
969
    ui->tableView_2->hideColumn(0);
974
    ui->tableView_2->hideColumn(0);
970
    ui->tableView_2->hideColumn(2);
975
    ui->tableView_2->hideColumn(2);
971
    ui->tableView_2->hideColumn(3);
976
    ui->tableView_2->hideColumn(3);
972
    ui->tableView_2->hideColumn(4);
977
    ui->tableView_2->hideColumn(4);
973
978