Project 06 of 11: 项目 06 / 11:Seamly2D Qt Development Internship南京图灵 Seamly2D 开发实习
In a three-week internship, I brought an unfamiliar Qt codebase into operation, added local accounts and role management, and prepared a Windows installer and an unsigned macOS package for review and handoff.三周实习里,我从配置 Qt、编译陌生代码库开始,为 Seamly2D 加入本地账户和角色管理,再完成 Windows 安装包与 macOS 无签名包的演示和交接。


Joining the Seamly2D Project进入 Seamly2D
In early August 2025 I finished the National Undergraduate Electronics Design Contest in Nanjing and went straight into a three-week, full-time internship in the same city, in the office from eight to five every day. I had expected to work on UI for embedded devices. What I actually had to change was Seamly2D, a large open-source C++ and Qt application for cutting and designing garment patterns. My C++ stopped at the level of the university's introductory course: functions and object-oriented basics, with inheritance only skimmed. Everything I had written lived in a terminal, one command in and one result out. I had never touched Qt or run an open-source desktop project of this size.
2025 年 8 月初,我在南京打完全国大学生电子设计竞赛,接着就在南京开始了三周的全职实习,早八点到晚五点坐办公室。我原本以为会去做嵌入式设备上的交互界面,结果要改的是 Seamly2D,一个用 C++ 和 Qt 写的大型开源服装纸样软件,能在上面裁剪、设计衣服的版型。那时我的 C++ 停在学校入门课的水平,函数和面向对象学过,继承只稍微了解了一下;写过的程序全在命令行里,敲一行命令,出一行结果。Qt 没碰过,这种体量的开源桌面项目也从来没跑过。

The company wanted to build on Seamly2D and first check whether a layer of account access could sit in front of the existing program. My supervising engineer's brief was clear: add local registration, login and role management before the main interface, then build, package and hand off the modified version. Each day he told me the day's task, and I reported back once it was done. Three weeks later, someone else had to be able to install my changes, open them and check them.
公司想在 Seamly2D 的基础上做二次开发,先验证能不能在原有程序前面加一层账户入口。带教工程师给我的任务很明确:在主界面之前加上本地注册、登录和角色管理,再把改好的版本构建、打包、交接。他每天跟我讲当天的任务,我做完去找他汇报。三周以后,要让别人能把我的改动装上、打开、检查一遍。
Environment and Build环境与构建
The first day went almost entirely on downloading. The Qt Online Installer was pulling from an overseas server, and after three hours the progress bar had reached about 10 percent. Assuming big software was just slow, I plodded along and waited most of the day. When I mentioned it to the engineer, he told me there was a Tsinghua mirror inside China. The next day I switched to the Tsinghua Qt mirror and the rest finished in a little over an hour. The me who had sat watching that progress bar the day before looked a bit like a clown, though it was the learn-from-it kind of foolishness, nothing like the real frustration still to come.
第一天几乎全耗在下载上。Qt 在线安装器连的是国外的服务器,下了三个小时,进度条才走到 10%。我以为大软件就是这么慢,坑吃坑吃等了大半天。跟带教工程师一提,他告诉我可以换国内的清华源。第二天换到清华的 Qt 镜像上,剩下的一个多钟头就下完了。前一天守着进度条的我,真跟个小丑一样,不过这种事属于吃一堑长一智,跟后面那种真烦躁不是一回事。
Installing Qt did not make it usable. I started with Qt 5.15.2 and made core5compat load conditionally, which got qmake through, only for the full build to report more than thirty errors. The branch had long since moved to Qt 6 headers and APIs, and patching in more Qt 5 compatibility would have taken me further and further from the task. I switched to Qt 6.5.3 MSVC2019 64-bit with the Qt 5 Compatibility Module and the v142 compiler, deleted the old build directory and Seamly2D.pro.user, configured the Kit again, and the full build finally went through. Once the versions matched, those thirty-odd errors went away with them.
装好也没法直接用。我先选了 Qt 5.15.2,把 core5compat 改成条件加载,qmake 是过了,完整编译却又报出三十多个错误。当前分支早就用上了 Qt 6 的头文件和 API,再去补 Qt 5 的兼容,只会离这次的任务越来越远。我改装 Qt 6.5.3 MSVC2019 64-bit 和 Qt 5 Compatibility Module,配 v142 编译器,删掉旧的 build 目录和 Seamly2D.pro.user,重新配 Kit,完整构建才终于跑通。版本一对上,那三十多个错误也跟着没了。
After that episode I got into the habit of checking branch, Qt package, compiler and architecture together. It was also my first real contact with a large project. GitHub had been a place to download code, and I had no picture at all of how several people develop together. Over these three weeks I learned clone, inspecting and switching upstream branches, creating my own development branch, commit, push, merge, pull requests, forks and tags from scratch, and used every one of them for real; Git turned out to be genuinely useful. How the environment was set up and each error handled is in the original first-run record I wrote at the time.
这么一折腾,我养成了把分支、Qt 包、编译器和架构放在一起对的习惯。这也是我第一次系统地碰大型项目。以前 GitHub 对我来说就是个下代码的地方,多人协作开发是怎么回事,脑子里完全没概念。这三周里,clone、查看并切换上游分支、建自己的开发分支、commit、push、merge、pull request、fork、tag,全是现学的,而且实打实用了一遍,我是真觉得 Git 好用。环境怎么配、每个报错怎么处理,记在我当时写的首跑原始记录里。
Accounts and Roles账户与角色
With the application running, I added registration and login windows and sorted out the sequence leading to the main interface around main(). Account information is stored locally with QSettings. Passwords started out as a plaintext comparison and became one-way hashed storage and verification; the input field got masking, and existing users, missing users and wrong passwords each got their own handling. Online access and a database were not part of this round, partly because I did not know how and partly because there was no hurry. The point was only to check whether Seamly2D could take one more layer of entry in front.
程序能跑以后,我加了注册和登录窗口,在 main() 附近理顺进入主界面的顺序。账户信息用 QSettings 存在本机。密码一开始是明文比对,后来改成不可逆的哈希存储和校验,输入框也加了遮挡,再把用户已存在、用户不存在、密码错误分开处理。线上联网和数据库这次没做,一来我不会,二来当时也不急,这一步本来就只是验证 Seamly2D 前面能不能再加一层入口。
Actually using the windows, no small problem could be dodged. Enter triggered Cancel by default, the username field popped up suggestions, and the password field once crashed with a Chinese input method active; I fixed them one by one. With role management, my attention moved from how a window looked to who could do what to whom. The first account had to be admin; normal users could not see the management entry; administrators could delete or promote only normal users, with a second confirmation before deletion; and only admin could demote another administrator. I implemented each operation by separating the current user, the target user and the allowed state change, then demonstrated them one at a time. Those rules get a second, closer look in Local Account Permission Rules.
界面真拿来用,小毛病一个都躲不掉。回车默认触发的是取消,用户名框会弹联想,开着中文输入法时密码框还闪退过,我一项项改掉。到了角色管理,心思就从窗口长什么样,转到了谁能对谁做什么。第一个账号必须是 admin;普通用户看不到管理入口;管理员只能删除或升级普通用户,删除前还要二次确认;其他管理员只能由 admin 来降级。我把每项操作按当前用户、目标用户和允许的状态变化拆开实现,再一项项演示。这几条规则后来又拆开细想了一遍,写在本地账户的权限判断里。
Windows Packaging and Another MachineWindows 打包与换机
In the third week I moved on to Release, and windeployqt held me up for at least three days. The tool was sitting right there on the disk, and the build step simply could not find it. Reinstalling, checking paths, round and round: those days were genuinely irritating. Which change finally did it I can no longer say for sure; at some point it just worked. According to the notes I kept, the final setup added Qt's bin directory to Qt Creator's Build Environment and had both .pro files locate the deployment tool through QT_INSTALL_BINS, running it only in the Release configuration.
第三周转去做 Release,windeployqt 卡了我至少三天。工具明明就在硬盘里,构建步骤就是找不到它。重装、查路径,来来回回,那几天是真烦。到底是哪一步起的作用,我自己都记不太清,反正某一刻它突然就找到了。按当时留下的记录,最后的做法是给 Qt Creator 的 Build Environment 补上 Qt 的 bin 目录,再让两个 .pro 文件通过 QT_INSTALL_BINS 去定位部署工具,只在 Release 配置下执行。
With the deployment folder already crammed with DLLs, the application still started up missing xerces-c_3_2.dll. Only after adding that XML parsing library could I finish Windows self-signing, the Inno Setup installer, installation and launch. According to Qt's deployment guide, additional third-party libraries were never windeployqt's job. The .sm2d and .smis samples I had read earlier now matched up with the XML parser the program needed. Why one DLL can still be missing among dozens is traced through the loading process in Qt Windows Runtime Dependencies.
部署目录里的 DLL 已经堆得满满当当,程序一启动还是缺 xerces-c_3_2.dll。补上这个 XML 解析库,才接着做完 Windows 自签名、Inno Setup 打包、安装和启动。按 Qt 的部署文档,额外的第三方库本来就不归 windeployqt 管。前面读过的 .sm2d、.smis 样例,到这里和程序要的 XML 解析依赖对上了。为什么一大堆 DLL 里还能缺一个,在Qt 程序的 Windows 运行依赖里顺着加载过程拆了一遍。
Alongside this I put together CMake and build-logic study material to tell generators, compilers, linkers and runtime dependencies apart, while the Seamly2D project in front of me stayed on qmake. The original packaging record and the XML samples hold the step-by-step procedures and data.
同期我还整理过 CMake 与编译原理的资料,用来分清生成器、编译器、链接器和运行时依赖,手上的 Seamly2D 则一直用的是 qmake。打包原始记录和 XML 样例里有具体操作和数据。
The formal Windows installation and feature checks took place on the development machine. About two weeks after the internship, back home, I tried again on a Windows desktop with a fresh system install and neither Qt nor Visual Studio on it. I ran the installer, double-clicked the result, and up came my modified version, with registration, login and roles all working.
正式验收时,Windows 的安装和功能检查都是在开发机上做的。实习结束大概半个月,我回到家,在一台刚装好系统的 Windows 台式机上又试了一次,那台电脑上没有 Qt,也没有 Visual Studio。直接运行安装程序,装完双击打开,就是我改过的那一版,注册、登录和角色功能都能用。
Mac and HandoffMac 与交接
I moved the same source onto my own Mac, reworked the Qt paths, architecture and Kit, and got both Debug and Release running. After macdeployqt collected the dependencies the application launched, and an unsigned DMG was generated and opened on that Mac while the supervising engineer watched the demonstration. I then created a self-signed certificate and tried the codesign, spctl and packaging-script sequence. Application signing never got finished, and exactly which step it stuck on I still cannot quite say. The engineer did not work on macOS; knowing the route was viable was enough for him, and he did not press further.
同一份源码我也搬到了自己的 Mac 上,重新处理 Qt 路径、架构和 Kit,Debug 和 Release 都跑通了。用 macdeployqt 收集完依赖,应用能启动,无签名的 DMG 也生成出来,在这台 Mac 上打开过,带教工程师现场看了演示。之后我建了自签名证书,试着走 codesign、spctl 和打包脚本那一套,应用签名到底没做完,具体卡在哪一步,我到现在也说不太清。工程师自己不用 macOS,知道这条路走得通,也就没再多问。
At the final review the engineer went through registration and login, role management, the Windows installation and the Mac demonstration item by item, and then gave me a proper round of praise: for someone who three weeks earlier had not known what Qt was, getting this far was seriously impressive. The source, weekly logs, environment notes and scripts were committed to the develop branch the company had opened for interns. How it was used afterwards, or whether it became part of a product, I do not know.
最后验收,工程师逐项看了注册登录、角色管理、Windows 安装和 Mac 演示,结结实实把我夸了一顿,说一个三周前连 Qt 是什么都不知道的人,能做到这一步相当厉害。源码、每周日志、环境文档和脚本都提交到了公司专门给实习生开的 develop 分支,后面怎么用、有没有做进产品,我就不清楚了。
That praise genuinely thrilled me. Three weeks earlier I had been going round in circles in a terminal; three weeks later I had walked into an unfamiliar large codebase, made a set of real changes, and handed them to someone else to check.
被这么一夸,我是真的兴奋。三周前我还在命令行里打转,三周后,我进了一个陌生的大型代码库,做完一组实打实的修改,又把它交到了别人手里检查。
Development notes开发笔记
Debugging records and technical notes tied to the decisions and artifacts on this project page.与这个项目页面中的设计决策和工程材料直接关联的调试记录与技术笔记。
- 01Local Account Permission Rules本地账户的权限判断Separating actor, target and action in Seamly2D role management, then checking state changes and persistence.从 Seamly2D 的本地角色管理出发,拆开操作者、目标账户与操作,再检查状态变化和保存结果。
- 02Qt Windows Runtime DependenciesQt 程序的 Windows 运行依赖Tracing a packaged Qt application through DLL loading, platform plugins and a clean-machine check.从缺少 DLL 的报错出发,研究 Qt 程序的动态依赖、平台插件与换机验证。
- 03Release Packaging Across Windows And macOSWindows 与 macOS Release 打包记录The original Seamly2D release packaging Markdown rendered as a full webpage note, covering Windows dependency collection, signing, Inno Setup, and follow-up packaging checks.把 Seamly2D Release 打包发布流程的原始 Markdown 直接渲染成完整网页笔记,覆盖 Windows 依赖收集、签名、Inno Setup 和后续验证。
- 04sm2d XML Sample Reading Notessm2d XML 样例文件观察笔记The original README note around the Seamly2D sample folder plus the full public .sm2d and .smis XML samples rendered on the note page.把 Seamly2D 样例文件夹 README 里的原话,以及公开 .sm2d / .smis XML 样例全文直接放到笔记页。
- 05CMake And Build Logic Learning NotesCMake 与编译底层逻辑学习笔记Two Notion-exported source notes rendered directly as the CMake/build-logic note: one CMake primer and one Qt-oriented compiler/toolchain map.把两份 Notion 导出的原始笔记直接渲染成 CMake / 编译底层逻辑笔记:一份 CMake 入门,一份 Qt 学习导向的编译器与工具链地图。
- 06Qt6 Seamly2D First Run NotesQt6 环境跑通 Seamly2D 的记录The original Windows 11 Qt6 Seamly2D onboarding text rendered directly as a webpage note, with the raw TXT/DOCX kept as source links.把 Windows 11 下 Qt6 跑通 Seamly2D 的原始记录直接渲染成网页笔记,并保留 TXT / DOCX 源文件链接。
Public Project Files公开项目资料
Uploaded evidence served from the public asset folder. Use the file index to preview documents, source code, media, PDFs, and downloadable artifacts without leaving the page.这里列出已经上传到公开目录的项目证据。可以在左侧索引里选择文件,在右侧直接预览文档、源码、媒体、PDF 和可下载附件。
auth-role-snippet.cpp
C++ / 705 B
// Public excerpt from the Seamly2D internship add-on.
// It shows the local role model only; full source and build outputs are not republished here.
namespace AuthUtils {
enum class Role {
User,
Admin
};
Role roleOf(const QString& username)
{
if (username.compare(QStringLiteral("admin"), Qt::CaseInsensitive) == 0) {
return Role::Admin;
}
QSettings settings;
settings.beginGroup(QStringLiteral("Auth/users/%1").arg(username));
const QString role = settings.value(QStringLiteral("role")).toString();
settings.endGroup();
if (role.compare(QStringLiteral("admin"), Qt::CaseInsensitive) == 0) {
return Role::Admin;
}
return Role::User;
}
}
Related media相关媒体
Board photos, schematic sheets, videos, and test captures that show this project at specific stages.展示这个项目具体阶段的板卡照片、原理图分页、视频和测试截图。
The upstream application behind the internship这段实习所基于的 Seamly2D 上游项目
Three weeks of full-time Qt development in Nanjing南京三周全职 Qt 实习
The Qt Kit that finally matched the source终于与源码配对的 Qt Kit
CMake study beside a qmake project在 qmake 项目旁展开的 CMake 学习
Separating rule generation from build execution把规则生成与构建执行分开
Build-toolchain archive sketch构建工具链档案草图
Notion-export copy of the CMake-to-Make tutorial diagramCMake 到 Make 教程图的 Notion 导出副本
Parent-child environment-variable flow父子进程的环境变量流向
Visual Studio, Windows SDK, and toolchain mapVisual Studio、Windows SDK 与工具链关系图
CMake configure-and-generate sequenceCMake 配置与生成阶段时序图
Ninja dependency-scheduling sequenceNinja 依赖调度时序图
CMake rule-generation pathCMake 构建规则生成路径
Ninja compile-and-link sequenceNinja 编译与链接时序图
Qt 6 package-discovery sequenceQt 6 包发现时序图
Qt 6 package search orderQt 6 包搜索顺序
Qt installation directory rolesQt 安装目录分工图
windeployqt dependency-collection sequencewindeployqt 依赖收集时序图
Qt runtime dependency mapQt 运行时依赖关系图
Build-failure first-check map构建失败的第一轮检查图