Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 220 → Rev 221

/trunk/DBViewer/mainwindow.cpp
77,13 → 77,15
getDatabaseData();
//// sql_mogel = new QSqlTableModel();
sql_mogel = new MyModel();
filtr_model = new MyModel();
filter_model = new MyModel();
 
 
model_is_build = true;
connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex)));
connect(model_for_ListModelsTable, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_model_for_ListModelsTable_dataChanged(QModelIndex,QModelIndex)));
connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
 
 
ui->pushButton_3->setEnabled(false);
ui->pushButton_4->setEnabled(false);
 
113,7 → 115,7
MainWindow::~MainWindow()
{
delete sql_mogel;
delete filtr_model;
delete filter_model;
delete ui;
delete model_for_ListModelsTable;
}
851,9 → 853,10
ui->pushButton_12->setEnabled(false);
// ui->tableView->reset();
// MainWindow::filtr_model->clear();
delete filtr_model;
filtr_model = new MyModel();
 
disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
delete filter_model;
filter_model = new QSqlTableModel();
connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
int index;
classesID_list = class_list_map.keys();
classesNameList = class_list_map.values();
877,9 → 880,12
QString class_id;
QString model_id;
QString filtr_str;
QString inctance;
QStringList conditionList;
class_id = item->text(1);
model_id = item->text(6);
inctance = MainWindow::getClassInctance(class_id);
 
filtr_str = tr("`Model_ID` = ");
filtr_str.append(model_id);
filtr_str.append(tr(" AND `Class_ID` = "));
886,14 → 892,16
filtr_str.append(class_id);
// filtr_str.append(tr("`"));
 
delete filtr_model;
disconnect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
delete filter_model;
// filtr_model = new MyModel();
 
filtr_model = new QSqlTableModel();
filtr_model->setTable(tr("Filters"));
filtr_model->setFilter(filtr_str);
filtr_model->select();
ui->tableView_3->setModel(filtr_model);
filter_model = new QSqlTableModel();
connect(filter_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_filter_model_dataChanged(QModelIndex,QModelIndex)));
filter_model->setTable(tr("Filters"));
filter_model->setFilter(filtr_str);
filter_model->select();
ui->tableView_3->setModel(filter_model);
 
 
ui->tableView_3->hideColumn(0);
946,7 → 954,7
ui->treeWidget->hideColumn(2);
ui->treeWidget->hideColumn(3);
ui->treeWidget->hideColumn(4);
ui->treeWidget->hideColumn(5);
// ui->treeWidget->hideColumn(5);
ui->treeWidget->hideColumn(6);
 
ui->tableView_2->hideColumn(0);