45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
#include <QApplication>
|
|
|
|
#include "DataBus.h"
|
|
|
|
#include "UiModules/appinit.h"
|
|
#include "UiModules/quiwidget.h"
|
|
#include "mainwindow.h"
|
|
#include "log_utils.h"
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
|
|
log_utils::init();
|
|
|
|
#ifdef _WIN32
|
|
SetConsoleOutputCP(CP_UTF8);
|
|
#endif // _WIN32
|
|
|
|
|
|
Bus::g_dataBusInstance = std::make_shared<Bus::DataBus>();
|
|
Bus::startIoContext();
|
|
Bus::g_dataBusInstance->setMainThreadId(std::this_thread::get_id());
|
|
|
|
std::ostringstream oss;
|
|
oss << u8"当前主线程id " << std::this_thread::get_id();
|
|
log_utils::info(oss.str());
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5,6,0))
|
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
#endif
|
|
QApplication a(argc, argv);
|
|
a.setFont(QFont("Microsoft Yahei", 10));
|
|
a.setWindowIcon(QIcon(":/logoG.ico"));
|
|
|
|
//QUIWidget::setCode();
|
|
//QUIWidget::setTranslator(":/image/qt_zh_CN.qm");
|
|
//QUIWidget::setTranslator(":/image/widgets.qm");
|
|
AppInit::Instance()->start();
|
|
|
|
MainWindow* pMainWindow = new MainWindow();
|
|
pMainWindow->show();
|
|
|
|
return a.exec();
|
|
}
|