Subversion Repositories OpenInventory

Compare Revisions

Regard whitespace Rev 145 → Rev 146

/trunk/DBViewer/mainwindow.h
81,7 → 81,7
void openBase();
bool readModel();
void setupModelData(const QStringList &lines, QTreeWidgetItem *parent);
void creatModelString();
QString creatModelString(QTreeWidgetItem* model);
QString modelString; // ñòðîêà, îïèñûâàþùàÿ ìîäåëü ïðåäñòàâëåíèÿ
void addChildsString(QTreeWidgetItem *parentItem, int level);
 
146,7 → 146,10
void on_pushButton_4_clicked();// íàæàòèå êíîïêè "Ñáðîñèòü èçìåíåíèÿ"
void on_pushButton_5_clicked();// íàæàòèå êíîïêè "Äîáàâèòü ìîäåëü "
void on_pushButton_6_clicked();// íàæàòèå êíîïêè "Óäàëèòü ìîäåëü "
void on_pushButton_7_clicked();// íàæàòèå êíîïêè "Ïðèìåíèòü" (íà âêëàäêå ìîäåëåé)
void on_pushButton_8_clicked();// íàæàòèå êíîïêè "Îòìåíèòü" (íà âêëàäêå ìîäåëåé)
void on_sql_mogel_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ); // èçìåíèëè ñâîéñòâà îáúåêòà èëè äîáàâèëè íîâûé îáúåêò
void on_model_for_ListModelsTable_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ); // èçìåíèëè ñâîéñòâà îáúåêòà èëè äîáàâèëè íîâûé îáúåêò
void applySetting();
void getSetting(); // îòêðîåì îêíî íàñòðîåê
};
/trunk/DBViewer/database.cpp
670,7 → 670,22
}
 
 
void MainWindow::on_pushButton_7_clicked(){// íàæàòèå êíîïêè "Ïðèìåíèòü"
model_for_ListModelsTable->submitAll();
ui->pushButton_7->setEnabled(false);
ui->pushButton_8->setEnabled(false);
model_is_build = false;
MainWindow::readModels();
model_is_build = true;
MainWindow::getDatabaseData();
}
 
void MainWindow::on_pushButton_8_clicked(){// íàæàòèå êíîïêè "Îòìåíèòü" (íà âêëàäêå ìîäåëåé)
model_for_ListModelsTable->select();
ui->pushButton_7->setEnabled(false);
ui->pushButton_8->setEnabled(false);
}
 
void MainWindow::on_sql_mogel_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ // èçìåíèëè ñâîéñòâà îáúåêòà èëè äîáàâèëè íîâûé îáúåêò
int i;
i++;
680,7 → 695,13
 
}
 
void MainWindow::on_model_for_ListModelsTable_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ // èçìåíèëè ñâîéñòâà îáúåêòà èëè äîáàâèëè íîâûé îáúåêò
 
ui->pushButton_7->setEnabled(true);
ui->pushButton_8->setEnabled(true);
}
 
 
// ïîëó÷àåì ñïèñîê âñåõ ïîëåé-óêàçàòåëåé, â êà÷åñòâå êëþ÷åé ïîëó÷èì èìåíà ïîëåé-óêàçàòåëåé
// â êà÷åñòâå çíà÷åíèé ïîëó÷èì ñïèñîê òàáëèö-õðàíèëèù îáúåêòîâ ðîäèòåëüñêèõ êëàññîâ
 
/trunk/DBViewer/mainwindow.cpp
64,6 → 64,8
 
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)));
 
ui->pushButton_3->setEnabled(false);
ui->pushButton_4->setEnabled(false);
 
252,12 → 254,14
*/
 
 
void MainWindow::creatModelString(){
QString MainWindow::creatModelString(QTreeWidgetItem* model){
 
MainWindow::modelString.clear(); // î÷èùàåì ñòðîêó ìîäåëè
// for (int i =0; i < rootItem1->childCount(); ++i )
 
{MainWindow::addChildsString(rootItem1, 0);}
{MainWindow::addChildsString(model, 0);}
 
return MainWindow::modelString;
// {MainWindow::addChildsString(ui->treeWidget, 0);}
/*
int root_item_child_count;
751,8 → 755,10
model_for_ListModelsTable = new QSqlTableModel(this);
 
model_for_ListModelsTable->setTable(tr("ListOfModels"));
model_for_ListModelsTable->setEditStrategy(QSqlTableModel::OnFieldChange);
 
// model_for_ListModelsTable->setEditStrategy(QSqlTableModel::OnFieldChange);
model_for_ListModelsTable->setEditStrategy(QSqlTableModel::OnManualSubmit);
ui->tableView_2->setModel(model_for_ListModelsTable);
model_for_ListModelsTable->select();
ui->pushButton_7->setEnabled(false);
ui->pushButton_8->setEnabled(false);
}