fix: disable smooth scaling for DQuickDciIconImage to prevent icon blur#581
fix: disable smooth scaling for DQuickDciIconImage to prevent icon blur#581deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSets DQuickDciIconImage to use non-smooth scaling by default to avoid blurred DCI icons in QML, aligning its behavior with Qt Widgets rendering. Class diagram for updated DQuickDciIconImage smooth behaviorclassDiagram
class QQuickItem
class QQuickImage {
+implicitWidthChanged()
+implicitHeightChanged()
+setSmooth(bool smooth)
}
class DQuickDciIconImagePrivate {
+QQuickImage* imageItem
}
class DQuickDciIconImage {
+DQuickDciIconImage(QQuickItem* parent)
+bool smooth
+void setSmooth(bool smooth)
+bool smoothChanged
}
DQuickDciIconImage --* DQuickDciIconImagePrivate : composition
DQuickDciIconImagePrivate --> QQuickImage : has
DQuickDciIconImage --|> QQuickItem
%% Key behavioral change: default smooth is now false in constructor
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The new
setSmooth(false)call happens before thesmoothChangedsignal is connected tod->imageItem, so the internalQQuickImagemay keep its default smooth value; consider either connecting the signal before callingsetSmooth, or explicitly initializingd->imageItem->setSmooth(false)to ensure both stay in sync.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `setSmooth(false)` call happens before the `smoothChanged` signal is connected to `d->imageItem`, so the internal `QQuickImage` may keep its default smooth value; consider either connecting the signal before calling `setSmooth`, or explicitly initializing `d->imageItem->setSmooth(false)` to ensure both stay in sync.
## Individual Comments
### Comment 1
<location path="src/private/dquickdciiconimage.cpp" line_range="211" />
<code_context>
, DObject(*new DQuickDciIconImagePrivate(this))
{
D_D(DQuickDciIconImage);
+ setSmooth(false);
connect(d->imageItem, &QQuickImage::implicitWidthChanged, this, [this, d]() { setImplicitWidth(d->imageItem->implicitWidth()); });
connect(d->imageItem, &QQuickImage::implicitHeightChanged, this, [this, d]() { setImplicitHeight(d->imageItem->implicitHeight()); });
</code_context>
<issue_to_address>
**issue (bug_risk):** Align initial smooth state of the wrapper and underlying imageItem.
Because `setSmooth(false)` is called before the `smoothChanged` connection is set up, the initial value is not propagated to `d->imageItem`, so the wrapper reports `smooth == false` while the underlying `imageItem` likely remains `true`. Please either move `setSmooth(false)` after the `smoothChanged` connection or explicitly initialize both objects’ `smooth` state (e.g. also call `d->imageItem->setSmooth(false)`).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Set smooth=false in constructor to match Qt Widgets rendering behavior. 在构造函数中设置 smooth=false 以匹配 Qt Widgets 渲染行为。 Log: 禁用 DQuickDciIconImage 平滑缩放 PMS: BUG-308655 Influence: 修复 QML 中 DCI 图标缩放时显示模糊的问题
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, re2zero 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 |
deepin pr auto review这份代码变更包含两部分:CMake配置文件的版权年份更新和C++类 1. 文件:
|
|
/forcemerge |
|
This pr force merged! (status: unstable) |
Set smooth=false in constructor to match Qt Widgets rendering behavior.
在构造函数中设置 smooth=false 以匹配 Qt Widgets 渲染行为。
Log: 禁用 DQuickDciIconImage 平滑缩放
PMS: BUG-308655
Influence: 修复 QML 中 DCI 图标缩放时显示模糊的问题
Summary by Sourcery
Bug Fixes: