[1287] 采用 QML 重新实现渐变选择器弹窗并恢复实时预览功能 - #4529
Merged
Merged
Conversation
- 删除根目录重复的 1287.py,EnvHook 收敛至 tests/Base/base.hpp - 渐变对话框改用 exec 退出码判断提交,bridge 所有权归调用方 - 预览源图缓存+预缩放,逐像素插值改 256 级灰度 LUT - 图案路径解析复用渲染器同款 resolve_pattern Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
任务简述
对应任务文档
devel/1287.md,解决 issue #4325 及渐变选择器缺失实时预览功能的问题。1. 采用 QML 重新实现渐变选择器(GradientSelector)
src/Plugins/Qt/qml/GradientSelector.qml,采用DialogShell+EnumCombo+DialogButtons现代圆角无边框模态弹窗;QFileDialog)、宽高比例调节、前景色与背景色设置(支持点击「选色」呼出原生 QMLColorPicker对话框);pixel = fg + gray * (bg - fg)即时重绘 QImage 生成 base64 PNG data URL,并在 QML 中丝滑无延迟渲染。2. 彻底根除 issue #4325 的 Use-After-Free 崩溃根因
src/Plugins/MuPDF/mupdf_picture.cpp:462的mupdf_load_pixmap中,效果构建时未对dest局部对象的tpix增加引用计数(缺少fz_keep_pixmap(ctx, tpix)),导致dest析构后该指针变成悬垂野指针,并在后续被二次释放和渲染解引用;fz_keep_pixmap(ctx, tpix)后彻底根除崩溃隐患。3. 测试与验证
tests/Plugins/Qt/gradient_selector_bridge_test.cpp(5/5 全部通过);1287.py(TeXmacs/tests/python/1287.py)全流程测试通过,包含自动进入文档、打开菜单弹出 QML 选择器、校验实时预览、确认应用渐变至文档背景且进程健康无崩溃。