AIChatForPC/YANG-ChatForQT/main.cpp
JasonYANG17 ddc6dc8404
add qt
2024-04-18 02:43:30 +08:00

33 lines
729 B
C++

#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();
}