AIChatForPC/YANG-ChatForQT/main.cpp

33 lines
729 B
C++
Raw Normal View History

2024-04-17 18:43:30 +00:00
#include "dialog.h"
#include "mainwindow.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "YANG-Chat_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
MainWindow w;
w.show();
// Dialog ws;
// ws.show();
//获取可用桌面大小
// 禁止拖动窗口大小
return a.exec();
}