Awes0meE / 66CCFF LabXJTLU Undergraduate西交利物浦大学本科生
Back to work返回项目

Nanjing Turing Qt, Build, and Packaging Learning Log南京图灵 Qt、编译与打包学习记录

An internship archive rebuilt from Nanjing Turing AI Research Institute traces: Qt/C++ onboarding, Seamly2D modification, CMake build reasoning, and Windows/macOS release packaging.从南京图灵人工智能研究院实习痕迹整理出的公开项目页:Qt/C++ 入门、Seamly2D 二次开发、CMake 编译理解,以及 Windows/macOS Release 打包流程。

Timeline时间线
2025.082025.08
Status状态
Completed已完成
Stack技术栈
QtC++CMakePackagingInternship
Nanjing Turing Qt, Build, and Packaging Learning Log

Brief简介

This page keeps a practical internship trail around Seamly2D, a Qt/C++ desktop application for clothing pattern design. The main story is ordinary but useful: get the project onto a Windows laptop, make Qt Creator stop complaining, add a small login/user-management layer, then figure out why a Release build still cannot run on another machine.

这页记录的是在南京图灵实习时围着 Seamly2D 做的一段学习和排错。它不是一个“做完了某个产品”的故事,更像真实实习里的节奏:先把项目拉下来,发现环境跑不通;换 Qt Kit、换编译器、删旧配置;能运行以后做一点登录注册和用户管理;最后再被 Release 打包、DLL、签名和 macOS 迁移继续折腾。

Seamly2D banner / Seamly2D 项目标识
Seamly2D bannerSeamly2D 项目标识

Source Folder源目录里有什么

The original folder had logs, study notes, scripts, sample files, and many generated artifacts. Only small reading material and cleaned excerpts were copied into the website. Full upstream source trees, build folders, installers, DLL piles, and huge delivery zips stayed out of public/uploads.

The useful public material now falls into a few tracks:

  • Three weekly development logs, moving from Qt setup, registration/login, and user management into Release packaging, signing, and macOS packaging.
  • A Windows 11 first-run note for Seamly2D, mostly about Qt5 failing, Qt6/MSVC2019 working, and choosing the right qmake and Kit.
  • A Windows Release packaging PDF, covering windeployqt, third-party DLLs, self-signing, and Inno Setup.
  • Two Notion-exported CMake/build-logic originals: one starts from CMake basics, the other connects MSVC, SDK, CMake, Ninja, and Qt package discovery.
  • macOS packaging scripts that tried to automate macdeployqt, DMG creation, and self-signing.
  • Seamly2D_addon/, covering login, registration, control panel, user management, password hashing, and role-control files.
  • sm2d and smis sample files for reading Seamly2D's XML data shape.

源目录里比较有用的是这些东西:

  • 三周开发日志:从 Qt 环境、注册登录、用户管理,到 Release、签名和 macOS 打包。
  • Windows 11 跑 Seamly2D 的流程记录:主要是 Qt5 失败、Qt6/MSVC2019 跑通、qmake 和 Kit 的选择。
  • Release 打包 PDF:Windows 下 windeployqt、第三方 DLL、自签名、Inno Setup 的步骤。
  • Notion 导出的 CMake 和编译底层逻辑原文:一份从 CMake 入门开始搭地基,一份把 MSVC、SDK、CMake、Ninja、Qt 包发现这些概念串起来。
  • macOS 打包脚本:尝试用 macdeployqt、DMG 和自签名把流程自动化。
  • Seamly2D_addon/:登录、注册、控制面板、用户管理、密码哈希和角色控制相关新增文件。
  • sm2dsmis 样例文件:用来观察 Seamly2D 的 XML 数据格式。

What I Actually Worked On实际做过的事

The first week was mostly about getting a working setup and adding the simplest account flow. Registration and login used QDialog and QSettings; password storage moved away from plain text to salted SHA-256 hashes; password inputs were masked; and a Chinese input-method crash around the login box was fixed by restricting input hints.

第一周的工作很像“先活下来”:项目能不能编译,Qt Creator 用哪个 Kit,main 里注册和登录怎么插进去,用户不存在、密码错误、用户已存在这些提示怎么给。很多改动都不大,但它们必须连起来,软件才不会一启动就把人挡在门外。

The second week added a small control-panel path. The first account had to be admin; administrators could see user management; normal users could not. User deletion, promotion, and demotion were added with confirmation prompts and role checks, including the rule that only admin could demote another administrator.

第二周主要补用户管理:控制面板窗口加大,增加“用户管理”,区分普通用户和管理员,管理员可以删除普通用户、提升普通用户,也能在限制条件下做降级。这里没有去大改 Seamly2D 主业务,只是在入口前加了一层轻量权限。

Build And Release编译与发布

The most time-consuming part was not writing another dialog. It was learning why the same Qt project behaves differently across machines. Qt5 and Qt6 were not interchangeable, core5compat mattered, MSVC v142 had to match the Qt package, old .pro.user files could poison the setup, and a Debug run inside Qt Creator did not mean a releasable folder existed.

真正耗时的是编译和打包。开发机里点绿色运行按钮可以跑,不代表把 exe 拷出来就能给别人用。Windows 侧要用 windeployqt 收依赖,还要补 xerces-c_3_2.dll 这类第三方库;再往后才是自签名、Inno Setup 和安装包。macOS 侧也一样,.app、frameworks、macdeployqt、签名、DMG 都要重新过一遍。

Handwritten build logic sketch / 编译逻辑手绘草图
Handwritten build logic sketch编译逻辑手绘草图

Public Files页面里保留的文件

These are small files that help explain the work without dumping a whole development folder:

Looking Back回头看

This internship archive feels like a learning site more than a polished feature showcase. Some parts are functional work, and some parts are simply the moment where the build system finally became less mysterious. A Qt project is not only source code: Kit, compiler, SDK, qmake/CMake rules, runtime libraries, and deployment tools all sit in the path.

Looking at it now, the most useful trace is not a login dialog. It is the first fairly complete pass from "runs on my machine" to "can be organized into files another machine might run." Broken environments, compiler conflicts, missing DLLs, and platform moves are less pretty than a final screenshot, but they are much closer to what the internship felt like.

这段实习留下来的东西很“学习现场”:有些地方是功能,有些地方只是把坑踩明白。比如 Qt 项目不能只看源码,还要看 Kit、编译器、SDK、qmake/CMake 规则和运行时依赖;Release 打包也不是最后点一下按钮,而是另外一套排查流程。

现在再看,它最有价值的部分不是某个登录框,而是第一次比较完整地经历了桌面软件从本机跑通到整理成可运行文件的过程。环境不通、编译器冲突、打包缺 DLL、换平台又重来,这些细节比漂亮的结果页更接近当时的实习状态。

Development Notes开发笔记

Project notes connected to hardware, firmware, documentation, and archive material.和这个项目相关的硬件、固件、文档和归档笔记。

Open notes archive打开笔记归档

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 和可下载附件。

35 files35 个文件

auth-role-snippet.cpp

C++ / 705 B

Open file打开文件
C++
// 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相关媒体

Images, videos, board renders, and public evidence connected to this project.和这个项目相关的图片、视频、板卡渲染图和公开证据。

Open media gallery打开媒体库
Seamly2D banner

Seamly2D bannerSeamly2D 项目标识

Seamly2D visual used for the Qt/C++ internship archive.南京图灵 Qt/C++ 实习档案页使用的 Seamly2D 项目标识。

Turing AI Institute cover

Turing AI Institute cover南京图灵人工智能研究院封面图

Processed institute logo cover for the Nanjing Turing Qt/CMake internship archive.南京图灵 Qt/CMake 实习档案页使用的研究院 Logo 封面图。

Qt logo used in the study folder

Qt logo used in the study folder学习目录里的 Qt 图

Qt visual kept with the Seamly2D first-run notes.和 Seamly2D 首次跑通记录一起保留的 Qt 图。

CMake logo

CMake logoCMake 标识

CMake logo kept with the build-logic learning material.编译逻辑学习资料里保留的 CMake 标识图。

CMake to Make flow

CMake to Make flowCMake 到 Make 的流程图

Diagram used while sorting out CMake, Make, and build-tool responsibilities.整理 CMake、Make 和底层构建工具分工时留下的流程图。

Handwritten build logic sketch

Handwritten build logic sketch编译逻辑手绘草图

Handwritten sketch from the toolchain and build-flow study notes.学习工具链和编译流程时画下来的手绘草图。

CMake tutorial reference diagram

CMake tutorial reference diagramCMake 教程参考流程图

Reference diagram kept beside the Notion-exported CMake study notes.随 Notion 导出的 CMake 学习笔记一起保留的参考流程图。

Compiler and architecture map

Compiler and architecture map编译器与架构关系图

Diagram used in the Qt-oriented build-logic source note.Qt 学习导向编译底层逻辑原文里使用的关系图。

Build toolchain map

Build toolchain map构建工具链关系图

Mermaid export from the build/toolchain learning note.编译与工具链学习笔记里导出的 Mermaid 图。

Platform and SDK flow

Platform and SDK flow平台与 SDK 流程图

Diagram connecting Windows architecture, SDK, compiler, and Qt build choices.把 Windows 架构、SDK、编译器和 Qt 构建选择串起来的图。

MSVC and Qt package map

MSVC and Qt package mapMSVC 与 Qt 包关系图

Visual note around matching Qt packages with the MSVC toolchain.围绕 Qt 包和 MSVC 工具链匹配关系整理出的视觉笔记。

CMake generator flow

CMake generator flowCMake 生成器流程图

Mermaid export showing how CMake hands work to a native build tool.展示 CMake 如何把任务交给本机构建工具的 Mermaid 图。

Ninja build flow

Ninja build flowNinja 构建流程图

Build-flow diagram kept with the Notion compiler notes.跟 Notion 编译笔记一起保留下来的构建流程图。

Qt CMake package discovery

Qt CMake package discoveryQt CMake 包发现流程图

Diagram for understanding how CMake locates Qt packages.理解 CMake 如何定位 Qt 包时整理出来的图。

Runtime dependency map

Runtime dependency map运行时依赖关系图

Dependency map from the build and deployment learning trail.编译与部署学习链路里留下的依赖关系图。

CMake cache flow

CMake cache flowCMake 缓存流程图

Diagram kept while sorting CMake cache behavior and reconfiguration.整理 CMake 缓存行为和重新配置过程时保留的图。

Build configuration map

Build configuration map构建配置关系图

Configuration map from the Notion build-logic note.Notion 编译底层逻辑笔记中的配置关系图。

Release runtime flow

Release runtime flowRelease 运行时流程图

Release-side flow diagram connected to deployment troubleshooting.和部署排错相关的 Release 侧流程图。

Qt build debugging map

Qt build debugging mapQt 编译排错关系图

Debugging map from the Qt/CMake toolchain learning notes.Qt/CMake 工具链学习笔记里整理出的排错关系图。