Awes0meE / 66CCFF LabXJTLU Undergraduate西交利物浦大学本科生
Back to notes返回笔记

2025-08-29

Three-Week Seamly2D Development LogSeamly2D 三周开发日志

The three Nanjing Turing weekly logs trace a practical path from Qt setup and login work to user management, then Windows/macOS release packaging.南京图灵三周实习日志:从 Qt 环境和登录注册,到用户管理,再到 Windows/macOS Release 打包。

QtSeamly2DInternshipPackaging
Related Project相关项目Nanjing Turing Qt, Build, and Packaging Learning Log南京图灵 Qt、编译与打包学习记录

Raw Log Files原始日志文件

The three raw text logs are still linked here. I treat them as the base evidence for this page:

原始三份 txt 还在。这里的叙述以它们作为底稿:

Week 1: Get The Qt Project Running第一周:先把 Qt 项目跑起来

第一周最先面对的就是环境。刚接触 Qt/C++,先要弄明白 Qt Creator、Kit、qmake、编译器、路径这些东西怎样凑在一起。把 Seamly2D 拉到本地以后,最急的任务是让项目能在自己的电脑上稳定启动。

The first week started with the environment. Since I was new to Qt/C++, I first had to understand how Qt Creator, Kit selection, qmake, compiler, and paths fit together. After cloning Seamly2D locally, the immediate task was to make it start reliably on my machine.

功能上,第一周从注册和登录入口开始。注册界面用 QSettings 保存用户信息,后来把密码从明文改成加盐哈希校验。登录界面接进 main 流程后,软件启动时会先经过注册/登录,再进入原来的 Seamly2D 主界面。

On the feature side, the first week began with registration and login. The registration UI stored user information through QSettings, and the password logic later moved from plaintext storage to salted hash verification. After the login screen was connected into main, the application passed through registration/login before entering the original Seamly2D interface.

这一周还有很多小交互:用户已存在、用户不存在、密码错误的提示;回车键从“取消”改成“确认”;密码输入改成隐藏显示。最具体的坑是中文输入法状态下输密码可能闪退,后来通过限制用户名和密码框的输入法提示绕过去。

That week also had many small interaction fixes: prompts for existing users, missing users, and incorrect passwords; changing Enter from cancel to confirm; and masking password input. The most concrete bug was a crash when typing a password with a Chinese input method active. Restricting input-method hints for the username and password fields worked around it.

Week 2: User Management And Roles第二周:用户管理和角色限制

第二周继续围着登录后的控制面板做。先把控制面板窗口调大,再加“用户管理”入口。第一次注册的账号必须叫 admin,这个规则直接写在首次注册页面,避免一开始就把管理员账号建错。

The second week continued around the control panel after login. I enlarged the control panel window and added a user-management entry. The first registered account had to be admin, and that rule was shown on the first-registration page to avoid creating the wrong initial account.

之后开始区分普通用户和管理员。管理员能看到用户管理入口,普通用户登录后看不到。用户管理界面里可以查看已注册用户,也能删除普通用户、提升普通用户、把管理员降级为普通用户。

Then the user types were split into normal users and administrators. Administrators could see user management; normal users could not. The user-management screen allowed viewing registered users, deleting normal users, promoting normal users, and demoting administrators to normal users.

真正要细想的是限制条件。删除用户前要确认;管理员只能删除普通用户;提升只能作用在普通用户;降级只有 admin 账号能做,其他管理员之间不能互相降级。规则本身不复杂,放进桌面软件后会变成一堆具体判断:当前是谁,目标是谁,按钮什么时候显示,点错了能不能取消,提示文字有没有说清楚。

The careful part was the restrictions. Deletion needed confirmation. Administrators could delete normal users. Promotion applied to normal users. Demotion could be performed by admin, so other administrators had no demotion path. The rules are simple, and desktop software turns them into concrete checks: current user, target role, button visibility, cancellation path, and prompt wording.

Week 3: Release And Packaging第三周:Release 和打包

第三周先看 .sm2d XML 样例,用它观察 Seamly2D 的数据结构。随后把 develop 分支完整跑通,把前两周的功能固定下来,工作重心转到 Release。

The third week started with reading a .sm2d XML sample to observe Seamly2D's data structure. After that, I brought up the develop branch fully, stabilized the previous feature work, and shifted toward Release.

Windows 侧的 Release 比预想长很多。先配置编译环境、处理电脑上的编译器版本冲突,再回头补 MSVC、CMake、Ninja、Qt 包发现这些底层编译逻辑。然后用 windeployqt 收 Qt 依赖,把程序整理成一个能独立运行的目录。

The Windows Release path took longer than expected. I configured the build environment, handled compiler-version conflicts, then studied the build logic around MSVC, CMake, Ninja, and Qt package discovery. After that I used windeployqt to collect Qt dependencies into a standalone runnable folder.

后面继续碰到签名和安装包。先研究 Windows 数字证书,创建自签名证书并给程序签名;再学 Inno Setup,把散落的 Release 文件整理成安装包。到这里,Release 编译、依赖收集、数字签名和安装包制作才连成一条可复述的流程。

Packaging brought signing and installer work. I studied Windows digital certificates, created a self-signed certificate, and signed the program. Then I learned Inno Setup and turned the loose Release folder into an installer. At that point Release build, dependency collection, signing, and installer packaging became one explainable workflow.

后半段切到 macOS。把 Windows 上已经开发过的代码搬到 Mac,重新配置 Qt 和编译环境。Homebrew Qt 和官方 Qt 的路径、架构不一样,Debug 先跑通,Release 再重新处理。macdeployqt 可以把依赖收进 .app,自签名证书也能创建,但正式发布级别的签名流程还没有完全走完。后来写了 shell 脚本,把编译、打包、依赖收集和签名检查尽量串起来。

The second half moved to macOS. I moved the Windows-side code to a Mac and reconfigured Qt and the compiler environment. Homebrew Qt and official Qt differed in paths and architecture, so I got Debug running first and then worked through Release again. macdeployqt collected dependencies into the .app, and a self-signed certificate could be created, while the full formal signing flow remained unfinished. I wrote shell scripts to connect build, packaging, dependency collection, and signature checks as far as possible.

实习收尾时,把这三周产生的文件按类别整理,补了开发日志和 README。那一步现在看挺重要,因为环境、脚本、包和日志如果不放回同一条线,过一段时间就很难讲清楚当时到底做了什么。

At the end of the internship, I sorted the files created during the three weeks by category and filled in the development logs and README. Looking back, that mattered: environment notes, scripts, packages, and logs need to sit on the same line, or the work becomes hard to explain later.

Looking Back回头看

这三周的线索其实很清楚:第一周是“项目能不能跑起来”,第二周是“入口和用户管理能不能用”,第三周是“程序能不能离开开发机”。每一步都很普通,但它们加起来就是桌面软件开发里真实会遇到的事。

The three-week thread is clear: week one asked whether the project could run, week two asked whether the entry point and user management could be used, and week three asked whether the program could leave the development machine. Each step was ordinary, and together they are close to real desktop software work.

现在回头看,最有用的经验是第一次把源码、工具链、本地配置、Release 文件夹、缺失 DLL、签名和平台差异放到同一个问题里看。Qt 项目离开开发机以后,打包和环境就变成项目本身的一部分。

Looking back, the useful experience was seeing source code, toolchain, local configuration, Release folder, missing DLLs, signing, and platform differences as one problem. Once a Qt project leaves the development machine, packaging and environment become part of the project itself.