#include "mainwindow.h"
#include "myhelper.h"
#include <QApplication>
#include <QDebug>
#include <QSqlDatabase>
#include <QSqlQuery>
#include "modeller_applog/applog.h" //日志
#include "sqliteassistant/sqliteassistant.h"    //数据库助手
#include "logindlg.h"   //登陆
int LogKeepDay = 0; //日志保存天数,
SqliteAssistant *m_SqliteAssistant;
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    myHelper::SetStyle("navy");
    Singleton<AppLog>::getInstance().start();

    m_SqliteAssistant = new SqliteAssistant();
    if(0!=m_SqliteAssistant->connectSql())
    {
        qDebug()<<"connectSql error";
        return 1;
    }
    else
    {
        qDebug()<<"connectSql ok";
    }
    //LogKeepDay
    Singleton<AppLog>::getInstance().onClearLogFile("./log",LogKeepDay);
    LoginDlg login;
    login.show();
    return a.exec();
}
