Subversion Repositories OpenInventory

Rev

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

Rev 226 Rev 227
Line 85... Line 85...
85
    //// sql_mogel = new QSqlTableModel();
85
    //// sql_mogel = new QSqlTableModel();
86
    sql_mogel = new MyModel();
86
    sql_mogel = new MyModel();
87
87
88
    /// filter_model = new MyModel();
88
    /// filter_model = new MyModel();
89
    filter_model = new QSqlTableModel();
89
    filter_model = new QSqlTableModel();
90
-
 
-
 
90
    filter_model->setEditStrategy(QSqlTableModel::OnManualSubmit);
91
91
92
    model_is_build = true;
92
    model_is_build = true;
93
    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)));
94
    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)));
95
    connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
95
    connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
Line 867... Line 867...
867
          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)));
868
        delete filter_model;
868
        delete filter_model;
869
869
870
        filter_model = new QSqlTableModel();
870
        filter_model = new QSqlTableModel();
871
       /// filter_model = new MyModel();
871
       /// filter_model = new MyModel();
-
 
872
    filter_model->setEditStrategy(QSqlTableModel::OnManualSubmit);
872
873
873
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
874
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
874
        int index;
875
        int index;
875
        classesID_list = class_list_map.keys();
876
        classesID_list = class_list_map.keys();
876
        classesNameList = class_list_map.values();
877
        classesNameList = class_list_map.values();
Line 909... Line 910...
909
        disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
910
        disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
910
        delete filter_model;
911
        delete filter_model;
911
  ///      filter_model = new MyModel();
912
  ///      filter_model = new MyModel();
912
913
913
        filter_model = new QSqlTableModel();
914
        filter_model = new QSqlTableModel();
-
 
915
       filter_model->setEditStrategy(QSqlTableModel::OnManualSubmit);
-
 
916
914
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
917
        connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
915
        filter_model->setTable(tr("Filters"));
918
        filter_model->setTable(tr("Filters"));
916
        filter_model->setFilter(filtr_str);
919
        filter_model->setFilter(filtr_str);
917
920
918
921
Line 937... Line 940...
937
        conditionList <<"" << "and" << "or" << "(" << "and (" << "or (";
940
        conditionList <<"" << "and" << "or" << "(" << "and (" << "or (";
938
        filterConditionDelegate.setItems(conditionList);
941
        filterConditionDelegate.setItems(conditionList);
939
        ui->tableView_3->setItemDelegateForColumn(3, &filterConditionDelegate);
942
        ui->tableView_3->setItemDelegateForColumn(3, &filterConditionDelegate);
940
943
941
        conditionList.clear();
944
        conditionList.clear();
942
        conditionList <<"" << "=" << "<" << ">" ;
945
        conditionList <<"" << "=" << "<" << ">" << "IS NULL" << "IS NOT NULL";
943
        filterConditionDelegate_1.setItems(conditionList);
946
        filterConditionDelegate_1.setItems(conditionList);
944
        ui->tableView_3->setItemDelegateForColumn(5, &filterConditionDelegate_1);
947
        ui->tableView_3->setItemDelegateForColumn(5, &filterConditionDelegate_1);
945
948
946
949
-
 
950
-
 
951
-
 
952
-
 
953
-
 
954
947
        ui->tableView_3->setItemDelegateForColumn(6, &filterValueDelegate);
955
        ui->tableView_3->setItemDelegateForColumn(6, &filterValueDelegate);
948
956
949
957
950
958
951
959