Repository navigation
fix: narrow resizeEvent updateSize condition to 1px - #800
18202781743 wants to merge 1 commit into
Conversation
1. Root cause: commit 36b4030 added updateSize() call in DDialog::resizeEvent triggered on any width change when WA_Resized is false, but this also fires during normal show()->updateSize()->resize() cycle causing recursive recalculation that shrinks layout to sizeHint width (286px) while window stays at default width (380px) 2. Fix: narrow the condition from width != oldWidth to qAbs(width - oldWidth) <= 1, matching the original intent of handling only fractional scaling 1px rounding differences 3. Impact: preserves BUG-370643 fractional scaling fix while preventing layout collapse on repeated show/hide/show cycles Log: Fix dialog layout collapse on second show after hide Influence: 1. Test DDialog show/hide/show cycle, verify buttons fill width 2. Test dialog under fractional scale (1.25x, 1.5x, 1.75x) 3. Verify first show and repeated show/hide maintain correct layout fix: 收窄 resizeEvent 中 updateSize 触发条件为 1 像素 1. 根因:commit 36b4030 在 DDialog::resizeEvent 中添加了 WA_Resized 为 false 且宽度变化时调用 updateSize() 的逻辑, 但该条件对任意宽度变化都触发,在正常 show()->updateSize() ->resize() 流程中导致递归重算,布局回缩到 sizeHint 宽度 (286px) 而窗口保持默认宽度 (380px) 2. 方案:将条件从 width != oldWidth 收窄为 qAbs(width - oldWidth) <= 1,仅处理小数缩放比例下的 1 像素舍入差异,符合原始设计意图 3. 影响:保留 BUG-370643 的小数缩放修复,同时消除反复 show/hide/show 时布局塌缩的问题 Log: 修复对话框第二次显示后按钮行布局塌缩的问题 Influence: 1. 测试 DDialog show/hide/show 循环,验证按钮行撑满窗口宽度 2. 测试小数缩放比例 (1.25x、1.5x、1.75x) 下对话框显示 3. 验证首次显示和反复 show/hide 后布局正常 PMS: BUG-381331
|
Sorry @18202781743, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 23 hours by commenting |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideNarrows DDialog::resizeEvent’s update-size condition to width changes of at most one pixel, retaining fractional scaling support while avoiding recursive recalculation that can collapse the layout during repeated show/hide cycles. Sequence diagram for DDialog resize handlingsequenceDiagram
participant DDialog
participant DAbstractDialog
DDialog->>DDialog: resizeEvent(QResizeEvent *event)
alt width difference <= 1px and not WA_Resized
DDialog->>DDialog: updateSize()
else width difference > 1px or already resized
DDialog->>DAbstractDialog: resizeEvent(event)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
修复内容
收窄
DDialog::resizeEvent中updateSize()触发条件,从width != oldWidth改为qAbs(width - oldWidth) <= 1,仅处理小数缩放比例下的 1 像素舍入差异。根因
commit
36b4030a在DDialog::resizeEvent中添加了对任意宽度变化都触发updateSize()的逻辑,在正常show()->updateSize()->resize()流程中导致递归重算,布局回缩到 sizeHint 宽度 (286px) 而窗口保持默认宽度 (380px)。影响范围
验证建议
关联 Issue
DDE-542
PMS: BUG-381331