更新语言设置

newClassify
bobpan 5 years ago
parent 8507f9936a
commit b86cb3d079

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -82,10 +82,10 @@
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OutputFile>$(SolutionDir)..\runner13\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;..\..\..\lpOpenCV\openCV2.4.9\build\x86\vc12\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(SolutionDir)..\runner17\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(OutDir);..\..\3part\opencv3.4.1\x64\vc15\lib;..\..\3part\Cyclops\lib;..\..\3part\edcircle\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>qtmain.lib;Qt5Core.lib;Qt5Gui.lib;opencv_core249.lib;opencv_imgproc249.lib;opencv_highgui249.lib;opencv_features2d249.lib;Cyclops.lib;luffy.lib;opencv_calib3d249.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Cyclops.lib;luffy.lib;opencv_world341.lib;EDCircle.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Profile>true</Profile>
</Link>
</ItemDefinitionGroup>

@ -940,6 +940,8 @@ Q_SLOT void QSystemSettingDlg::oncurrentChanged(const QString &str)
{
QString strObjName = sender()->objectName();
if ("m_Language" == strObjName) {
emit sgChangeLanguage(str);
//emit(sgGenalData("languageSeting", str));
}
}

@ -1,4 +1,4 @@
#ifndef _H_QSYSTEMSETTINGUI_H_
#ifndef _H_QSYSTEMSETTINGUI_H_
#define _H_QSYSTEMSETTINGUI_H_
#include <QWidget>
@ -17,6 +17,8 @@ public:
~QSystemSettingDlg();
void onShowWidget(int level);
signals:
void sgChangeLanguage(QString strLanguage);
private:
bool InitTreeWidget(QTreeWidget* pTreewidget);
void addComRoot(class QTreeWidget *pTreewidget, QString strName /*= QString()*/);

@ -1,4 +1,4 @@
#ifndef _H_QTIMEMGRDLG_H_
#ifndef _H_QTIMEMGRDLG_H_
#define _H_QTIMEMGRDLG_H_
#include <QDialog>
@ -6,7 +6,7 @@
#include "InfoFile.h"
#include "IWheelCtrl.h"
class TimeMgrCtrl;
/*班次管理窗口页面*/
/*班次管理窗口页面*/
class QTimeMgrDlg : public QDialog
{
Q_OBJECT

@ -78,8 +78,8 @@ lpMainWin::lpMainWin(QWidget *parent)
}
{//加载语言设置
QSettings languageSetting("hubdetect.ini", QSettings::IniFormat);
QString strLangeage = languageSetting.value("language", "Chinese").toString();
SetLanguage(strLangeage);
QString strLanguage = languageSetting.value("language", "Chinese").toString();
SetLanguage(strLanguage);
}
{
m_pLbCurrentTime = new QLabel(tr("系统时间"));
@ -138,6 +138,7 @@ lpMainWin::lpMainWin(QWidget *parent)
m_pSystemSettingDlg = new QSystemSettingDlg();//系统设置
m_CamSettingDlg = new QCamSettingDlg();
m_CamSettingDlg->setCoreCtrlPtr(m_pCoreCtrl);
connect(m_pSystemSettingDlg, SIGNAL(sgChangeLanguage(QString)), this, SLOT(onLanguageChange(QString)));
m_pixMapList = new QPixmapListBar(ui.tp_main_tabWidget);
ui.tp_main_tabWidget->insertTab(0, m_pixMapList, tr("历史"));
@ -1240,6 +1241,13 @@ void lpMainWin::onInitAbout()
//m_lightBox->setLayout(lbLayout);
}
Q_SLOT void lpMainWin::onLanguageChange(QString strLanguage)
{
QSettings languageSetting("hubdetect.ini", QSettings::IniFormat);
languageSetting.setValue("language", strLanguage);
SetLanguage(strLanguage);
}
void lpMainWin::onShowResult(Result2Ui* pRlt)
{
if (!pRlt)

@ -1,4 +1,4 @@
#ifndef _H_LPMAINWIN_H_
#ifndef _H_LPMAINWIN_H_
#define _H_LPMAINWIN_H_
#include <QMainWindow>
@ -30,11 +30,11 @@ public:
lpMainWin(QWidget *parent = Q_NULLPTR);
~lpMainWin();
//接收图像回调函数
//接收图像回调函数
void INewCameraImage(const QString& camKey, QImage img);
//接收算法检测结果回调函数
//接收算法检测结果回调函数
void IVariantMapToUI(const QString& camKey, const QVariantMap& vMap);
//传输算法参数回调函数
//传输算法参数回调函数
QVariant IGetVariantById(int id);
signals:
void sgTaskSendModels(int nIndex, QString strModel, double dDiameter, double dHeight);
@ -69,9 +69,9 @@ private:
protected:
bool onInitCoreCtrl();
void loadUserModel();//加载用户管理模块
void loadUserModel();//加载用户管理模块
//国际化
//国际化
void SearchQmFile(const QString & strDir);
void SetTranslator(const QString strPath);
void SetLanguage(QString strLangage);
@ -80,7 +80,7 @@ protected:
void SendTickTskFun();
void onSetModel();
Q_SLOT void onUpdateDefect();//勾选 更新界面显示窗口
Q_SLOT void onUpdateDefect();//勾选 更新界面显示窗口
//net slot
Q_SLOT void onTcpConnet(QString str, bool bConnect);
Q_SLOT void onClientConnect(QString addr, bool bConnect);
@ -108,8 +108,10 @@ protected:
Q_SLOT void onTriggerCam();
void onInitAbout();
Q_SLOT void onLanguageChange(QString strLanguage);
private:
void onShowResult(Result2Ui* pRlt);//展示识别结果
void onShowResult(Result2Ui* pRlt);//展示识别结果
void SendResultBee(emTypeBee m_Type, int num);
void SendResultStr2PLC(Result2Ui* m_Res);
@ -131,12 +133,12 @@ private:
class QLabel* main_showWorkLabel{ nullptr };
class ModelsView *m_pTableCheck{ nullptr };
RoiImgViewer *m_ImgViewer{ nullptr };//展示检测图像
/*status 状态栏*/
class QLabel* m_pLbCurrentTime{ nullptr };//显示系统时间
class QLabel* m_pLbBanci{ nullptr };//显示班次
class QLabel* m_pLbDetectState{ nullptr };//显示检测状态
class QLabel *m_pLbUser{ nullptr };//显示登陆用户信息
RoiImgViewer *m_ImgViewer{ nullptr };//展示检测图像
/*status 状态栏*/
class QLabel* m_pLbCurrentTime{ nullptr };//显示系统时间
class QLabel* m_pLbBanci{ nullptr };//显示班次
class QLabel* m_pLbDetectState{ nullptr };//显示检测状态
class QLabel *m_pLbUser{ nullptr };//显示登陆用户信息
private:
CDllCoreCtrl* m_pDllCoreCtrl{ nullptr };
ICoreCtrl* m_pCoreCtrl{ nullptr };
@ -158,27 +160,27 @@ private:
QThread *pTickThread{ nullptr };
int m_nWfThress{ 0 };
int m_TimerID{ 0 };//心跳包定时器 用于记录超时
int m_TimerID{ 0 };//心跳包定时器 用于记录超时
int m_TimerOutCount{ 0 };
int m_RestartServerCount{ 0 };
QStringList forDefectList;
int m_nDiffTrigNum{ 0 };//触发次数 用于判断相机是否正常打开
int m_nDiffTrigNum{ 0 };//触发次数 用于判断相机是否正常打开
//模板管理页面
//模板管理页面
QModelMgrDlg *m_pModelMgrDlg{ nullptr };
QDebugDlg* m_pDebugDlg{ nullptr };
QWidget m_aboutDlg;//关于
QWidget m_aboutDlg;//关于
QTimeMgrDlg* m_pTimerMgrDlg{ nullptr };
QPixmapListBar* m_pixMapList{ nullptr };//展示历史检测结果
QPixmapListBar* m_pixMapList{ nullptr };//展示历史检测结果
QSystemSettingDlg* m_pSystemSettingDlg{ nullptr };
QCamSettingDlg* m_CamSettingDlg{ nullptr };
private:
IUserCtrl *m_pUserCtrl{ nullptr };//用户管理模块
IUserCtrl *m_pUserCtrl{ nullptr };//用户管理模块
QVector<QTranslator* > m_VecTranPtr;//国际化语言包管理
QVector<QTranslator* > m_VecTranPtr;//国际化语言包管理
int m_timerID{ 0 };//定时器 更新状态栏信息
int m_timerID{ 0 };//定时器 更新状态栏信息
};
#endif

@ -1358,7 +1358,7 @@
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OutputFile>$(SolutionDir)..\runner13\$(TargetName)$(TargetExt)</OutputFile>
<OutputFile>$(SolutionDir)..\runner17\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(OutDir);..\..\3part\opencv3.4.1\x64\vc15\lib;..\..\3part\Cyclops\lib;..\..\3part\libzkq\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5AxContainer.lib;Qt5AxBase.lib;Qt5Sql.lib;Qt5PrintSupport.lib;Qt5Network.lib;Qt5SerialPort.lib;libzkq.lib;luffy.lib;Cyclops.lib;opencv_world341.lib;%(AdditionalDependencies)</AdditionalDependencies>

Loading…
Cancel
Save