1 Star 0 Fork 11

jerry.xu/Qt application library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
XZPCode.cpp 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
#include "XZPCode.h"
#include "ui_XZPCode.h"
#include"kits/Tools.h"
#include"DemoUI/DemoWidget.h"
#include"exception/XException.h"
#include"hidusb/HidDev.h"
#include"ssh/SshAdapter.h"
#ifdef PIN_YIN
#include"pinyin/PinyinAdapter.h"
#endif
XZPCode::XZPCode(QWidget *parent) :
QWidget(parent),
ui(new Ui::XZPCode)
{
ui->setupUi(this);
}
XZPCode::~XZPCode()
{
xPrint;
delete ui;
}
void XZPCode::testException()
{
QStringList mList;
try{
if(mList.isEmpty()) throw XException("QStringList is Empty");
mList.takeFirst();
}catch(XException& e){
xPrint<<e.what();
}
}
void XZPCode::testPinyin()
{
#ifdef PIN_YIN
PinyinAdapter pyAdapter;
QString pinyin; //拼音输出
QString abbrev; //首字母简写
pyAdapter.pinyinParse(tr("从前有座山"),pinyin,abbrev);
xPrint<<pinyin<<abbrev;
#elif
xPrint<<"please load pinyin module first ";
#endif
}
void XZPCode::on_btn_exception_clicked()
{
testException();
}
void XZPCode::on_btn_pinyin_clicked()
{
testPinyin();
}
void XZPCode::on_btn_Div_widget_clicked()
{
DemoWidget::Instance()->show();
}
void XZPCode::on_btn_crash_clicked()
{
QStringList m;
m.takeFirst();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/xuxincode/Qt-application-library.git
git@gitee.com:xuxincode/Qt-application-library.git
xuxincode
Qt-application-library
Qt application library
master

搜索帮助