#include <QApplication>
#ifdef _WIN32
#include <QTextCodec>
#include <Windows.h>
#endif
#include "./BackEnd/MainWidget.h"
#include "Application.h"
#include "Renderive/architecture/export.h"
#include "Renderive/plot/Plot.h"
int main(int argc, char* argv[]) {
    Application app(argc, argv);
    Application::setAttribute(Qt::AA_UseHighDpiPixmaps);
    Back_End::instance();
    QFile file(":/qss/ElegantDark.qss");
    file.open(QIODevice::ReadOnly);
    QString stylesheet = QLatin1String(file.readAll());
    file.close();
    app.setStyleSheet(stylesheet);
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#ifdef _WINDOWS
    SetConsoleOutputCP(CP_UTF8);
    system("chcp 65001");
    //setbuf(stdout, 0);
#endif
    Main_Widget w;
    app.main_widget = &w;
    renderive::start_render_scheduler();
    w.show();
    return QApplication::exec();
}
