Language change example
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <QPushButton>
|
||||
#include "systemsettingform.h"
|
||||
#include "AccountTableForm.h"
|
||||
#include "event/EventCenter.h"
|
||||
|
||||
AdminSettingForm::AdminSettingForm(QWidget* parent, Qt::WindowFlags f) : TabFormWidget(parent) {
|
||||
|
||||
@@ -65,12 +66,19 @@ AdminSettingForm::AdminSettingForm(QWidget* parent, Qt::WindowFlags f) : TabForm
|
||||
stackedWidget->addWidget(operationLogForm);
|
||||
|
||||
QLabel* about = new QLabel(this);
|
||||
about->setText("About");
|
||||
about->setText(tr("About"));
|
||||
stackedWidget->addWidget(about);
|
||||
widget->setCurrentRow(0);
|
||||
connect(widget, &QListWidget::currentRowChanged, [=](int rowindex) {
|
||||
stackedWidget->setCurrentIndex(rowindex);
|
||||
});
|
||||
connect(EventCenter::Default(),&EventCenter::ReloadLanguage,[=](){
|
||||
QStringList menus;
|
||||
menus << tr("General") << tr("Account Manage") << tr("System Setting") << tr("System Information") << tr("Operation Log") << tr("About");
|
||||
widget->clear();
|
||||
widget->addItems(menus);
|
||||
about->setText(tr("About"));
|
||||
});
|
||||
}
|
||||
|
||||
AdminSettingForm::~AdminSettingForm() {
|
||||
|
||||
Reference in New Issue
Block a user