Repository navigation
fix: replace function-static pinch state and mechanical-safe Qt6 deprecated APIs - #417
Merged
deepin-bot[bot] merged 3 commits intoOct 14, 2026
Merged
Conversation
Reviewer's GuideFixes pinch gesture state leakage by making state instance-owned and resetting it across gesture lifecycles, documents DPdfPage ownership, and removes selected Qt6 deprecation warnings through guarded or equivalent API substitutions; packaging metadata is also updated. Sequence diagram for isolated pinch gesture lifecyclesequenceDiagram
participant Gesture as QPinchGesture
participant BrowserA as SheetBrowser instance A
participant BrowserB as SheetBrowser instance B
participant Sheet as Sheet
Gesture->>BrowserA: pinchTriggered(gesture)
BrowserA->>BrowserA: GestureStarted resets m_currentStepScaleFactor
BrowserA->>BrowserA: Store m_tempScalefactor and m_canRotate
Gesture->>BrowserA: ScaleFactorChanged
BrowserA->>Sheet: setScaleFactor(curscalfactor)
Gesture->>BrowserA: GestureCanceled
BrowserA->>BrowserA: Clear pinch state
Gesture->>BrowserB: pinchTriggered(gesture)
BrowserB->>BrowserB: Uses instance-owned pinch state
BrowserB->>Sheet: setScaleFactor(curscalfactor)
Flow diagram for guarded Qt6 API compatibilityflowchart LR
Start["Qt-dependent API call"] --> Version{"Qt version"}
Version -->|"Qt5"| Qt5["Use Qt5 API"]
Version -->|"Qt6"| Qt6["Use Qt6 replacement"]
Qt5 --> Equivalent["Equivalent application behavior"]
Qt6 --> Equivalent
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot TAG: 6.6.2 |
The pinch gesture state (canRotate, currentStepScaleFactor, tempScalefactor) in SheetBrowser::pinchTriggered lived in function-level statics: they leaked across SheetBrowser instances (multi-window pollution), survived across unit-test runs, and left a stale scale baseline behind when a gesture was interrupted without GestureFinished, making the next pinch jump (too-sensitive scaling, BUG44491 deep cause). Move them to SheetBrowser members, reset the scale baseline on GestureStarted, and also clean up on GestureCanceled. Log: 捏合手势状态由函数级 static 改为成员变量,手势开始时重置缩放基线,取消时同样清理 Influence: 修复多窗口捏合互相污染与手势打断后下次捏合缩放过灵敏的问题(BUG44491 深层根因)
DPdfDoc::page() caches the returned DPdfPage in the document (freed by qDeleteAll in ~DPdfDocPrivate), so deleting it from the caller side is a double-free. Declare the ownership contract in dpdfdoc.h page() and the DPdfPage class docs in dpdfpage.h. Log: 在 dpdfdoc.h/dpdfpage.h 注释中声明 DPdfDoc::page 返回指针的所有权契约 Influence: 仅文档注释变更,提示调用方不得 delete page() 返回的 DPdfPage,避免双重释放
add-uos
force-pushed
the
fix/ut-scan-20261010
branch
from
October 10, 2026 05:22
ccc1c79 to
fe2437b
Compare
- Application.cpp: guard AA_UseHighDpiPixmaps with Qt5-only check (no effect in Qt6) and replace deprecated isTopLevel() with isWindow() - MainWindow.cpp: replace deprecated QHoverEvent::pos() with position().toPoint() (Qt6 branch) and QLibraryInfo::location() with path() (same pattern as Model.cpp) - XpsDocumentAdapter.cpp: pass QTimeZone::UTC to fromSecsSinceEpoch instead of the deprecated Qt::UTC overload (behavior equivalent) - SecurityDialog.cpp / TransparentTextEdit.cpp: replace deprecated QString::count() with size() Deferred (structural, behavior-sensitive): QMouseEvent deprecated constructor in Application.cpp (new ctor needs a global position the synthesized cursor point cannot provide); the 4 fontChanged connects in CatalogTreeView/RestoreTipWidget/PagingWidget/ScaleWidget (replacing the signal with QEvent::ApplicationFontChange handling restructures event processing). Log: 替换机械安全的 Qt6 废弃 API:AA_UseHighDpiPixmaps/isTopLevel/pos/location/fromSecsSinceEpoch/count Influence: 消除 9 处 Qt6 废弃 API 警告,行为不变(等价替换);fontChanged 4 处与 QMouseEvent 构造评估后暂缓
add-uos
force-pushed
the
fix/ut-scan-20261010
branch
from
October 10, 2026 05:35
e217c38 to
e408891
Compare
lzwind
approved these changes
Oct 12, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
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.
概述
本 PR 由单元测试/PMS 扫描缺陷甄别流程发现,对 13 条「单元测试/PMS 扫描发现的源码缺陷/静态分析发现」逐条甄别核对后,修复确认的问题并驳回误报/上游已修复项。
修复项(确认)
评估后暂缓(不改动,注明原因)
驳回项(误报/上游已修复,不改代码)
验证
Log: 甄别 13 条扫描缺陷:修复捏合手势 static 状态泄漏、page 所有权契约说明与 9 处 Qt6 废弃 API,驳回 6 条已修复/误报项
Influence: 修复多窗口捏合互相污染与手势打断后缩放过灵敏(BUG44491 深层根因);消除 Qt6 废弃 API 警告;行为均为等价替换
Summary by Sourcery
Eliminate persistent pinch-state contamination, clarify PDF page ownership, and maintain Qt6 compatibility by removing deprecated API usage.
Bug Fixes:
Enhancements: