qt_demoe/control/zhtopy/frmzhtopy.cpp

25 lines
516 B
C++
Raw Normal View History

2019-11-06 07:40:28 +00:00
#include "frmzhtopy.h"
#include "ui_frmzhtopy.h"
#include "zhtopy.h"
frmZhToPY::frmZhToPY(QWidget *parent) : QWidget(parent), ui(new Ui::frmZhToPY)
{
ui->setupUi(this);
2021-11-17 07:33:19 +00:00
ZhToPY::Instance()->loadPY(":/data/zhtopy.txt");
2019-11-06 07:40:28 +00:00
}
frmZhToPY::~frmZhToPY()
{
delete ui;
}
void frmZhToPY::on_btnPY_clicked()
{
ui->txtResult->setText(ZhToPY::Instance()->zhToPY(ui->txtChinese->text()));
}
void frmZhToPY::on_btnJP_clicked()
{
ui->txtResult->setText(ZhToPY::Instance()->zhToJP(ui->txtChinese->text()));
}