⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testtrdlg.cpp

📁 这个是从外网下的中英文切换的例子
💻 CPP
字号:
#include <QMessageBox>
#include "testTrDlg.h"
#include <QApplication>

testTrDlg::testTrDlg(QWidget * parent):QDialog(parent)
{
	setupUi(this);
	
	connect(engBtn,  SIGNAL(clicked()), this, SLOT(english()));
	connect(chsBtn,  SIGNAL(clicked()), this, SLOT(chinese()));
	connect(loveBtn, SIGNAL(clicked()), this, SLOT(ILoveMyFamily()));
	connect(testBtn, SIGNAL(clicked()), this, SLOT(testTr()));

	translator = new QTranslator(this);
	translator->load("Language_Chn");
	qApp->installTranslator(translator);

	retranslateUi(this);
}

testTrDlg::~testTrDlg()
{

}

void testTrDlg::english()
{
	translator->load("Language_Eng");
	retranslateUi(this);
}

void testTrDlg::chinese()
{
	translator->load("Language_Chn");
	retranslateUi(this);
}

void testTrDlg::ILoveMyFamily()
{
	QMessageBox::information(this, loveBtn->text(), loveBtn->text());
}

void testTrDlg::testTr()
{
	QMessageBox::information(this, testBtn->text(), testBtn->text());
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -