mirror of
https://gitee.com/eda-development/eda_fpga.git
synced 2025-08-14 01:32:27 +08:00
增加多语言
This commit is contained in:
@ -17,6 +17,8 @@ RC_ICONS = icon.ico
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
TRANSLATIONS += English.ts\
|
||||
Chinese.ts
|
||||
|
||||
SOURCES += \
|
||||
about_dialog.cpp \
|
||||
|
@ -1110,3 +1110,23 @@ void MainWindow::on_actionAdd_to_popular_triggered()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::on_actionChinese_triggered()
|
||||
{
|
||||
QTranslator m;
|
||||
QString currentPath = QCoreApplication::applicationDirPath();
|
||||
m.load(currentPath+"/lang/Chinese.qm");
|
||||
qApp->installTranslator(&m);
|
||||
this->ui->retranslateUi(this);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEnglish_triggered()
|
||||
{
|
||||
QString currentPath = QCoreApplication::applicationDirPath();
|
||||
QTranslator m;
|
||||
m.load(currentPath+"/lang/English.qm");
|
||||
qApp->installTranslator(&m);
|
||||
this->ui->retranslateUi(this);
|
||||
}
|
||||
|
@ -81,6 +81,10 @@ private slots:
|
||||
|
||||
void on_actionAdd_to_popular_triggered();
|
||||
|
||||
void on_actionChinese_triggered();
|
||||
|
||||
void on_actionEnglish_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
|
@ -137,7 +137,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<property name="geometry">
|
||||
@ -149,7 +149,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Page 1</string>
|
||||
<string>Popular</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="toolbox_system">
|
||||
@ -162,7 +162,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>System</string>
|
||||
<string>Examples</string>
|
||||
</attribute>
|
||||
<widget class="QListView" name="listView_left">
|
||||
<property name="geometry">
|
||||
@ -377,9 +377,29 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="title">
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuPreferences">
|
||||
<property name="title">
|
||||
<string>Preferences</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuLanguage">
|
||||
<property name="title">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
<addaction name="actionChinese"/>
|
||||
<addaction name="actionEnglish"/>
|
||||
</widget>
|
||||
<addaction name="menuLanguage"/>
|
||||
</widget>
|
||||
<addaction name="menuPreferences"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuCode"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
@ -458,6 +478,16 @@ p, li { white-space: pre-wrap; }
|
||||
<string>Add to popular</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChinese">
|
||||
<property name="text">
|
||||
<string>Chinese</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEnglish">
|
||||
<property name="text">
|
||||
<string>English</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
Reference in New Issue
Block a user