Skip to content

fix: 修复配置页面返回时悬空 Qt 对象访问 - #70

Open
LevelDownRefine wants to merge 1 commit into
OneDragon-Anything:mainfrom
LevelDownRefine:lvdown/fix_runtime
Open

fix: 修复配置页面返回时悬空 Qt 对象访问#70
LevelDownRefine wants to merge 1 commit into
OneDragon-Anything:mainfrom
LevelDownRefine:lvdown/fix_runtime

Conversation

@LevelDownRefine

@LevelDownRefine LevelDownRefine commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

fix #65

Summary by CodeRabbit

  • Bug 修复
    • 改善设置卡片组对已失效或已销毁控件的处理,避免更新分隔线时发生异常。
    • 优化分隔线显示状态更新,提升设置界面的稳定性。

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

ExpandSettingCardGroup 在更新分隔线时新增 Qt 对象有效性检查,避免访问已销毁的自身或设置卡片,并保留原有的分隔线显示与视图尺寸刷新逻辑。

Changes

Qt 对象有效性保护

Layer / File(s) Summary
分隔线更新有效性防护
src/one_dragon_qt/widgets/setting_card/expand_setting_card_group.py
引入 shiboken6.isValid,在 _update_separators 中跳过无效对象,避免访问已销毁卡片的可见性状态。

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: shadowlemoon

Poem

我是小兔蹦蹦跳,
失效卡片不再瞧。
分隔线儿稳稳亮,
销毁对象绕开跑。
Qt 安全真美妙!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 修改通过检查 QObject 有效性并跳过失效卡片,符合 #65 关于悬空 Qt 对象访问的修复目标。
Out of Scope Changes check ✅ Passed 变更仅集中在目标方法的防御性修复,没有明显引入与 #65 无关的改动。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次修改的核心:修复配置页面返回时的悬空 Qt 对象访问问题。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/one_dragon_qt/widgets/setting_card/expand_setting_card_group.py`:
- Around line 79-81: 在遍历 _card_sep_pairs 的逻辑中,更新无效卡片的处理:在 continue 前检查关联的 sep
是否仍有效,并将其隐藏;保持有效卡片的现有处理流程不变。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 42fe79c4-39d2-4255-acc1-3d5a9d0f030d

📥 Commits

Reviewing files that changed from the base of the PR and between 7d2bebe and 892bd88.

📒 Files selected for processing (1)
  • src/one_dragon_qt/widgets/setting_card/expand_setting_card_group.py

Comment thread src/one_dragon_qt/widgets/setting_card/expand_setting_card_group.py
@LevelDownRefine LevelDownRefine changed the title fix: 修复配置页面返回时的 C++ 对象已销毁错误 fix: 修复配置页面返回时悬空 Qt 对象访问 Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

悬空 Qt 对象访问

1 participant