Subversion Repositories OpenInventory

Rev

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

Rev 127 Rev 131
Line 22... Line 22...
22
    file_tmp.close();
22
    file_tmp.close();
23
23
24
    ui->treeWidget->setAlternatingRowColors(true);
24
    ui->treeWidget->setAlternatingRowColors(true);
25
    ui->treeWidget_2->setAlternatingRowColors(true);
25
    ui->treeWidget_2->setAlternatingRowColors(true);
26
    MainWindow::openDataBase();
26
    MainWindow::openDataBase();
27
    MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("7"));
27
    MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("1"));
28
    MainWindow::initComboBox();
28
    MainWindow::initComboBox();
29
    getDatabaseData();
29
    getDatabaseData();
30
    //// sql_mogel = new QSqlTableModel();
30
    //// sql_mogel = new QSqlTableModel();
31
    sql_mogel = new MyModel();
31
    sql_mogel = new MyModel();
32
32
Line 250... Line 250...
250
250
251
251
252
bool MainWindow::openDataBase(){
252
bool MainWindow::openDataBase(){
253
    QString errorString;
253
    QString errorString;
254
    sql = QSqlDatabase::addDatabase("QMYSQL");
254
    sql = QSqlDatabase::addDatabase("QMYSQL");
255
    sql.setDatabaseName(tr("an_db"));
255
//    sql.setDatabaseName(tr("an_db"));
-
 
256
-
 
257
    sql.setDatabaseName(tr("inventory"));
256
    sql.setHostName(tr("localhost"));
258
    sql.setHostName(tr("localhost"));
-
 
259
-
 
260
-
 
261
-
 
262
257
    sql.setUserName(tr("an"));
263
    sql.setUserName(tr("an"));
258
    sql.setPassword(tr("393939"));
264
    sql.setPassword(tr("393939"));
259
265
260
    bool ok;
266
    bool ok;
261
    ok = sql.open();
267
    ok = sql.open();