Subversion Repositories OpenInventory

Rev

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

Rev 95 Rev 97
Line 19... Line 19...
19
    QTextStream out(&file_tmp);
19
    QTextStream out(&file_tmp);
20
    out << MainWindow::modelString;
20
    out << MainWindow::modelString;
21
    file_tmp.close();
21
    file_tmp.close();
22
22
23
    MainWindow::openDataBase();
23
    MainWindow::openDataBase();
24
    MainWindow::buildPreviewModel(tr("3"));
24
    MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("3"));
25
25
26
}
26
}
27
27
28
MainWindow::~MainWindow()
28
MainWindow::~MainWindow()
29
{
29
{
Line 277... Line 277...
277
277
278
     return ok;
278
     return ok;
279
}
279
}
280
280
281
281
282
bool MainWindow::buildPreviewModel(QString rootClassID){
282
bool MainWindow::buildPreviewModel(QString modelName, QString rootClassID){
283
QSqlQuery q;
283
QSqlQuery q;
284
QString sql_str;
284
QString sql_str;
285
QString field_name_str;
285
QString field_name_str;
286
QString root_class_name;
286
QString root_class_name;
287
bool ok;
287
bool ok;
Line 290... Line 290...
290
//ui->treeWidget->clear();
290
//ui->treeWidget->clear();
291
291
292
root_class_name = MainWindow::ClassName(rootClassID); // îïðåäåëÿåì èìÿ êëàññà
292
root_class_name = MainWindow::ClassName(rootClassID); // îïðåäåëÿåì èìÿ êëàññà
293
293
294
rootItem1 = new  QTreeWidgetItem(ui->treeWidget);
294
rootItem1 = new  QTreeWidgetItem(ui->treeWidget);
295
 rootItem1->setText(0, root_class_name);
295
 rootItem1->setText(0, modelName);
296
// rootItem2 = new  QTreeWidgetItem(rootItem1);
-
 
297
// rootItem2->setText(0, tr("óðîâåíü 2"));
-
 
-
 
296
298
 rootItem1->setCheckState(0,Qt::Checked);
297
 rootItem1->setCheckState(0,Qt::Checked);
299
298
300
299
-
 
300
rootItem2 = new  QTreeWidgetItem(rootItem1);
-
 
301
rootItem2->setText(0, root_class_name);
-
 
302
rootItem2->setText(1, rootClassID);
-
 
303
rootItem2->setCheckState(0,Qt::Checked);
-
 
304
301
305
302
306
303
sql_str = tr("select * "
307
sql_str = tr("select * "
304
             " from DescriptionOfClasses where  DescriptionOfClasses.DefaultValue = '"       //îïðåäåëèì êëàññû, äëÿ êîòîðûõ êîðíåâîé ÿâëÿåòñÿ êîíòåéíåðîì
308
             " from DescriptionOfClasses where  DescriptionOfClasses.DefaultValue = '"       //îïðåäåëèì êëàññû, äëÿ êîòîðûõ êîðíåâîé ÿâëÿåòñÿ êîíòåéíåðîì
305
             );
309
             );