#include "ui/main/MainWindow.h"
#include "core/database/DogDatabase.h"
#include "core/database/UAVDatabase.h"
#include <QApplication>
#include <QtSql>
#include <QSqlDatabase>
#include <QIcon>
#include <QQuickWindow>
#include <QSurfaceFormat>

int main(int argc, char *argv[])
{
    // 设置软件渲染以避免GPU上下文问题
    QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);

    // 设置OpenGL格式为软件渲染
    QSurfaceFormat format;
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setProfile(QSurfaceFormat::CompatibilityProfile);
    QSurfaceFormat::setDefaultFormat(format);

    QApplication a(argc, argv);

    //设置窗口图标
    QIcon icon(":/image/res/image/logo_backgroundless.png");
    a.setWindowIcon(icon);

    MainWindow w;
    w.show();
    QStringList lis= QSqlDatabase::drivers();
    for (int i=0;i<lis.length();i++) {
        qDebug() <<"dri:"<<lis[i];
    }

    return a.exec();
}
