13b3ebbe14
把川大 wiki「02.Qt方向」课程代码整理为 CMake 管理的可编译运行项目。
Part1 C/C++ 强化 (p01/, 144 目标, host gcc/g++ 构建, 全绿):
- 修复全部编译失败:补 <cstring>/<fstream>/<iomanip>/<vector> 等缺失头
(common_fix + infer_stl_includes 自动检测注入)、修正 pause() 壳注入
(改检测已转换后的 pause 调用)、namespace 提升出函数体、const 成员函数
正确性、dedupe 不再破坏函数重载集、K&R 隐式 int / 动态异常规范等
C++17 移除特性的可编译等价改写。
- 目录采用深缩写 p01/ch04/s03/ (原 part1_cpp/ch04_class_object/03_ctor_dtor)。
Part3 Qt 桌面 (p03/, 29 目标, 隔离 Qt 5.14.2 构建, 全绿):
- gen_part3.py: Qt 外壳模板 (main+QApplication+show, QTimer 自动退出便于
offscreen 验证)、AUTOMOC + .moc include、rewrite_* 处理散文混入/重载/
资源依赖、生成占位 png/gif + .qrc + rundata 样例数据。
- 修正 QLable 笔误、全角分号、.→->、Windows 路径、QApplication 阻塞事件
循环改为 QCoreApplication 等。
任务1 概念/版本验证:
- tools/std_probe.py: 跨 -std= 编译探针 (--pedantic-errors 让已废除特性硬失败)。
- tools/demo_versions/: K&R 隐式 int、三目左值、void* 转换、enum 赋整、
const 经指针、动态异常规范 共 6 个跨版本演示。
- docs/VERSION_NOTES.md: 每条「原文说法→C17/C++17 是否成立→何版本成立→已验证」。
文档: 顶层 README、docs/SOURCE_PAGES.md (页面→目录映射)、
docs/ERRATA.md (Part1 修正)、docs/ERRATA_part3.md (Part3 修正)。
另修复 tools/run.sh / run_qt.sh 的 ${1:?...} 引号语法 bug。
隔离 Qt 验证: ldd 0 系统 Qt 引用; 173/173 目标全绿; p03 offscreen 运行通过。
1 line
6.2 KiB
JSON
1 line
6.2 KiB
JSON
{"id":"58954513","type":"page","status":"current","title":"1 Qt概述","version":{"by":{"type":"known","username":"ethanliu","userKey":"2c90931b6cfb654f016d5c69becc0001","profilePicture":{"path":"/images/icons/profilepics/default.svg","width":48,"height":48,"isDefault":true},"displayName":"刘浩","_links":{"self":"https://wiki.suncaper.net/rest/api/user?key=2c90931b6cfb654f016d5c69becc0001"},"_expandable":{"status":""}},"when":"2022-07-09T01:51:25.000Z","message":"","number":1,"minorEdit":false,"hidden":false,"_links":{"self":"https://wiki.suncaper.net/rest/experimental/content/58954513/version/1"},"_expandable":{"content":"/rest/api/content/58954513"}},"body":{"storage":{"value":"<h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"a2a70545-276d-4b88-9645-ea1029973b22\"><ac:parameter ac:name=\"\">_Toc466556749</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"77e6942c-f484-40bb-853e-1c2f8db8b9bb\"><ac:parameter ac:name=\"\">_Toc471841977</ac:parameter></ac:structured-macro>1.1 什么是Qt</h1><p>Qt是一个<span style=\"color: rgb(255,0,0);\"><strong>跨平台</strong></span>的C++<span style=\"color: rgb(255,0,0);\"><strong>图形用户界面应用程序框架</strong></span>。它为应用程序开发者提供建立艺术级图形界面所需的所有功能。它是完全面向对象的,很容易扩展,并且允许真正的组件编程。</p><h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"2961e570-cda0-4c7f-af85-5368497481f6\"><ac:parameter ac:name=\"\">_Toc466556750</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"d38b5810-3277-4c5f-a896-a9ddc0a3ef00\"><ac:parameter ac:name=\"\">_Toc471841978</ac:parameter></ac:structured-macro>1.2 Qt的发展史</h1><p>1991年 Qt最早由奇趣科技开发<br />1996年 进入商业领域,它也是目前流行的Linux桌面环境KDE的基础<br />2008年 奇趣科技被诺基亚公司收购,Qt称为诺基亚旗下的编程语言<br />2012年 Qt又被Digia公司收购<br />2014年4月 跨平台的集成开发环境Qt Creator3.1.0发布,同年5月20日配发了Qt5.3正式版,至此Qt实现了对iOS、Android、WP等各平台的全面支持。<br />当前Qt最新版本为 5.9.0</p><h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"ed84edf5-306e-43ff-809a-9257f6121b0e\"><ac:parameter ac:name=\"\">_Toc466556751</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"d35de487-3d4c-467e-a3ec-f4328b80b51c\"><ac:parameter ac:name=\"\">_Toc471841979</ac:parameter></ac:structured-macro>1.3 支持的平台</h1><ul><li>Windows – XP、Vista、Win7、Win8、Win2008、Win10</li><li>Uinux/X11 – Linux、Sun Solaris、HP-UX、Compaq Tru64 UNIX、IBM AIX、SGI IRIX、FreeBSD、BSD/OS、和其他很多X11平台</li><li>Macintosh – Mac OS X</li><li>Embedded – 有帧缓冲支持的嵌入式Linux平台,Windows CE</li></ul><h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"f5b7593c-7335-4b35-861f-9498576c769b\"><ac:parameter ac:name=\"\">_Toc466556752</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"aacc9ffb-5f16-43b3-9139-7a0c5ec875b4\"><ac:parameter ac:name=\"\">_Toc471841980</ac:parameter></ac:structured-macro>1.4 Qt版本</h1><p>Qt按照不同的版本发行,分为商业版和开源版</p><ul><li>商业版</li></ul><p>为商业软件提供开发,他们提供传统商业软件发行版,并且提供在商业有效期内的免费升级和技术支持服务。</p><ul><li>开源的LGPL版本:</li></ul><p>为了开发自有而设计的开放源码软件,它提供了和商业版本同样的功能,在GNU通用公共许可下,它是免费的。</p><h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"5432278d-3ce8-426d-b2f8-783e8e6e286f\"><ac:parameter ac:name=\"\">_Toc466556759</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"ace077a4-9be9-4635-924c-95ae405c6bc6\"><ac:parameter ac:name=\"\">_Toc471841987</ac:parameter></ac:structured-macro>1.6 Qt的优点</h1><ul><li>跨平台,几乎支持所有的平台</li><li>接口简单,容易上手,学习QT框架对学习其他框架有参考意义。</li><li>一定程度上简化了内存回收机制</li><li>开发效率高,能够快速的构建应用程序。</li><li>有很好的社区氛围,市场份额在缓慢上升。</li><li>可以进行嵌入式开发。</li></ul><p><ac:image ac:height=\"461\" ac:width=\"607\"><ri:attachment ri:filename=\"worddavd912fdc7f2ff433e56414cb7c7c3cab4.png\" /></ac:image></p><h1><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"983489b6-d061-42cb-a06c-a4372d6cfd9b\"><ac:parameter ac:name=\"\">_Toc466556760</ac:parameter></ac:structured-macro><ac:structured-macro ac:name=\"anchor\" ac:schema-version=\"1\" ac:macro-id=\"e7fd0bf2-2b64-4085-acca-0bb32ba8cc93\"><ac:parameter ac:name=\"\">_Toc471841988</ac:parameter></ac:structured-macro>1.7 成功案例</h1><ul><li>Linux桌面环境KDE</li><li>WPS Office 办公软件</li><li>Skype 网络电话</li><li>Google Earth 谷歌地图</li><li>VLC多媒体播放器</li><li>VirtualBox虚拟机软件</li><li>…</li></ul><p><br /></p>","representation":"storage","_expandable":{"content":"/rest/api/content/58954513"}},"_expandable":{"editor":"","view":"","export_view":"","styled_view":"","anonymous_export_view":""}},"extensions":{"position":1},"_links":{"webui":"/pages/viewpage.action?pageId=58954513","edit":"/pages/resumedraft.action?draftId=58954513","tinyui":"/x/EZODAw","collection":"/rest/api/content","base":"https://wiki.suncaper.net","context":"","self":"https://wiki.suncaper.net/rest/api/content/58954513"},"_expandable":{"container":"/rest/api/space/2CT","metadata":"","operations":"","children":"/rest/api/content/58954513/child","restrictions":"/rest/api/content/58954513/restriction/byOperation","history":"/rest/api/content/58954513/history","ancestors":"","descendants":"/rest/api/content/58954513/descendant","space":"/rest/api/space/2CT"}} |