Qt开发打字动效软件
看到vs有炫酷的打字动效插件,心痒难耐,自己也想用上,可自己用的是QtCreator,无奈之下,只好用Qt写一个小软件,实现打字动效
一、软件设计
1.QueryKeyThread
类实现windows下光标位置识别和键盘按键识别
2.Widget
类实现加载qml
界面,并根据QueryKeyThread
识别,触发界面通信
3.qml
界面使用粒子实现动效
4.效果

理论上能识别windows上所有编辑框,但是在部分编辑软件中坐标有点偏差
二、打包程序
三、发布程序
为了生成开始菜单和桌面快捷方式,要修改installscript.qs
文件
Component.prototype.createOperations = function()
{
// call default implementation to actually install README.txt!
component.createOperations();
if (systemInfo.productType === "windows") {
component.addOperation("CreateShortcut", "@TargetDir@/qmlDemoWinKeyKaTong.exe", "@StartMenuDir@/qmlDemoWinKeyKaTong.lnk",
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/qmlDemoWinKeyKaTong.exe",
"iconId=0", "description=@TargetDir@/qmlDemoWinKeyKaTong.exe");
component.addOperation("CreateShortcut", "@TargetDir@/qmlDemoWinKeyKaTong.exe", "@HomeDir@/Desktop/qmlDemoWinKeyKaTong.lnk",
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@/qmlDemoWinKeyKaTong.exe",
"iconId=0", "description=@TargetDir@/qmlDemoWinKeyKaTong.exe");
}
}
四、安装程序







网友评论