mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 19:27:38 +08:00
31 lines
558 B
C++
31 lines
558 B
C++
#include "AppInfo.h"
|
|
#include "lang/En.h"
|
|
#include "lang/Zh.h"
|
|
#include <QDebug>
|
|
|
|
#define STR(x) #x
|
|
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
|
|
#define VER_JOIN_(x) VER_JOIN x
|
|
#define VER_STR VER_JOIN_((VERSION))
|
|
|
|
AppInfo::AppInfo(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
version(VER_STR);
|
|
lang(new En());
|
|
}
|
|
|
|
void AppInfo::changeLang(const QString& locale){
|
|
if(_lang){
|
|
_lang->deleteLater();
|
|
}
|
|
if(locale=="Zh"){
|
|
lang(new Zh());
|
|
}else if(locale=="En"){
|
|
lang(new En());
|
|
}else {
|
|
lang(new En());
|
|
}
|
|
|
|
}
|