Beispiel #1
0
int main(int argc, char** argv)
{
    QApplication app(argc, argv);

    new UIManager;
    new DBManager;

    DBManager* db = DBManager::instance();
    UIManager* ui = UIManager::instance();

    //char* fn = "vega.udb";
    char* fn = "geometryprocess.udb";
    //char* fn = "vega.udb";
    //char* fn = "vega.udb";

    char* fileName = argc > 1 ? argv[1] : fn;
    printf(fileName);

    db->openDB(fileName);

    ui->lockAll();
    db->parse();
    ui->unlockAll();

    ui->updateScene();
    ui->addMainUI();
    //ui->addMainUI();
    ui->showAllUI();

    app.exec();
    DBManager::instance()->closeDB();

    return 0;
}
Beispiel #2
0
int main(int argc, char *argv[])
{
    int currentExitCode = 0;
    do
    {
        QApplication a(argc, argv);
        a.setWindowIcon(QIcon(":/general/icons/New-climber.png"));
        DBManager db;
        if (!db.openDB())
            QMessageBox::critical(0, "Base de dados", "Não foi possível conectar ao banco de dados\n"
                                  "Entre em contato com o desenvolvedor", QMessageBox::Cancel);
        MainWindow w;
        w.show();
        currentExitCode = a.exec();
    }while(currentExitCode == MainWindow::EXIT_CODE_REBOOT);

    return currentExitCode;
}