fix: QComboBox ignore wheel event when not reacting to it - #66
Conversation
|
Hi @wjyrich. Thanks for your PR. 😃 |
|
Hi @wjyrich. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ae9a31d to
b8c1908
Compare
|
TAG Bot TAG: 6.8.0+dfsg-0deepin34 |
Cherry picked from qtbase upstream dev branch commit 9c966d837fe33b1e32f5e95f29a380dd3063055b
("QComboBox: Ignore wheel event when not reacting to it").
When SH_ComboBox_AllowWheelScrolling is false, combo boxes did not react to
wheel scrolling but also did not ignore the event, so it was eaten instead of
propagating up. Parent scroll areas therefore never scrolled.
Log: 从上游 cherry-pick 修复 QComboBox 未响应滚轮时未向外传递滚轮事件的问题
Influence: 当 QStyle::SH_ComboBox_AllowWheelScrolling 为 false 时,滚轮事件会向上冒泡,外层 QScrollArea 等控件可正常滚动。
PMS: BUG-339039
b8c1908 to
3d8e67f
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
/test ai-review |
|
/test all |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰。else { e->ignore(); } 分支正确处理了 QComboBox 不响应滚轮事件时的事件传播,符合 Qt 事件传播机制。测试代码使用数据驱动测试(QFETCH/QCOMPARE)结构规范。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 代码结构清晰,注释完整。上游 commit message 详细解释了修复原因和背景。测试代码覆盖全面,包含自定义 QProxyStyle 和事件接收检测。建议修正补丁文件名中的大小写不一致问题。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。修改仅添加 e->ignore() 调用(O(1) 操作),无额外计算开销或资源消耗。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。本次修改仅涉及 GUI 事件传播逻辑,无用户输入处理、网络通信、文件 I/O 或命令执行,不存在安全风险。 💡 改进建议代码示例// 修正补丁文件名
// 原文件名: debian/patches/fix-ComboBox-Wheelevent.patch
// 建议改为: debian/patches/fix-ComboBox-WheelEvent.patch
//
// 同时需要更新 debian/patches/series 中的引用(如存在)
//
// 核心代码修复无需改动,当前实现已正确:
// qcombobox.cpp - wheelEvent 函数
void QComboBox::wheelEvent(QWheelEvent *e)
{
// ...
if (style()->styleHint(QStyle::SH_ComboBox_AllowWheelScrolling)) {
// 处理滚轮滚动
d->emitActivated(d->currentIndex);
e->accept();
} else {
e->ignore(); // 新增:忽略事件,使其向上传播
}
}本报告由 AI 代码审查工具自动生成 |
Cherry picked from qtbase upstream dev branch commit 9c966d837fe33b1e32f5e95f29a380dd3063055b ("QComboBox: Ignore wheel event when not reacting to it").
When SH_ComboBox_AllowWheelScrolling is false, combo boxes did not react to wheel scrolling but also did not ignore the event, so it was eaten instead of propagating up. Parent scroll areas therefore never scrolled.
Log: 从上游 cherry-pick 修复 QComboBox 未响应滚轮时未向外传递滚轮事件的问题
Influence: 当 QStyle::SH_ComboBox_AllowWheelScrolling 为 false 时,滚轮事件会向上冒泡,外层 QScrollArea 等控件可正常滚动。
PMS: BUG-339039