-
Notifications
You must be signed in to change notification settings - Fork 42
fix: set retainWhileLoading to true for DQuickDciIconImage #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#557
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures that DQuickDciIconImage’s internal DQuickIconImage retains its previous visual content while loading new data on Qt 6.8.0+ by explicitly enabling the retainWhileLoading property in the private class constructor, preventing flicker/blank states during icon reloads. Sequence diagram for icon reload with retainWhileLoading enabledsequenceDiagram
actor User
participant DQuickDciIconImage as DQuickDciIconImage
participant DQuickDciIconImagePrivate as DQuickDciIconImagePrivate
participant DQuickIconImage as DQuickIconImage
participant IconSource as IconSource
User->>DQuickDciIconImage: requestIconChange(newSource)
DQuickDciIconImage->>DQuickDciIconImagePrivate: setSource(newSource)
DQuickDciIconImagePrivate->>DQuickIconImage: setSource(newSource)
Note over DQuickIconImage: Qt version >= 6.8.0
DQuickDciIconImagePrivate->>DQuickIconImage: setRetainWhileLoading(true)
DQuickIconImage->>IconSource: load(newSource)
activate IconSource
DQuickIconImage-->>DQuickDciIconImage: retainWhileLoadingChanged(true)
DQuickDciIconImage-->>User: icon visually unchanged while loading
IconSource-->>DQuickIconImage: new image data
deactivate IconSource
DQuickIconImage-->>DQuickDciIconImage: cacheChanged()
DQuickDciIconImage-->>User: display updated icon without flicker
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b2d4bd2 to
c933302
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#557
1. Added explicit call to setRetainWhileLoading(true) for the internal imageItem in DQuickDciIconImagePrivate constructor 2. This ensures that when Qt version is 6.8.0 or higher, the icon image retains its previous visual state while loading new content 3. The change prevents visual flickering or blank states during icon loading transitions Log: Fixed icon flickering issue during loading by enabling retainWhileLoading property Influence: 1. Test icon loading transitions to ensure no flickering occurs 2. Verify that icons maintain their previous appearance while loading new content 3. Test with various DCI icon sources and loading states 4. Confirm compatibility with Qt 6.8.0 and higher versions fix: 为 DQuickDciIconImage 设置 retainWhileLoading 为 true 1. 在 DQuickDciIconImagePrivate 构造函数中为内部 imageItem 显式调用 setRetainWhileLoading(true) 2. 确保当 Qt 版本为 6.8.0 或更高时,图标图像在加载新内容时保留其先前的视 觉状态 3. 此更改防止图标加载过渡期间出现视觉闪烁或空白状态 Log: 通过启用 retainWhileLoading 属性修复图标加载时的闪烁问题 Influence: 1. 测试图标加载过渡,确保不会出现闪烁 2. 验证图标在加载新内容时是否保持其先前的外观 3. 使用各种 DCI 图标源和加载状态进行测试 4. 确认与 Qt 6.8.0 及更高版本的兼容性 PMS: BUG-346973
c933302 to
b64ba7a
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#557
deepin pr auto review这段代码修改主要涉及构造函数的逻辑调整和 Qt 6.8 新特性的适配。以下是对该 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与修改建议这段代码的主要意图是适配 Qt 6.8 的新 API 并重构构造函数逻辑,但引入了致命的语法错误。 建议修改后的代码如下: // 修正公有构造函数:调用基类而非自身,并保留异步设置
DQuickIconImage::DQuickIconImage(QQuickItem *parent)
: QQuickImage(*(new DQuickIconImagePrivate), parent)
{
setAsynchronous(true); // asynchronous by default
}
// 受保护构造函数保持原样或添加注释
DQuickIconImage::DQuickIconImage(DQuickIconImagePrivate &dd, QQuickItem *parent)
: QQuickImage(dd, parent)
{
setAsynchronous(true);
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
// 优化加载体验:在加载新资源时保持当前图像显示
setRetainWhileLoading(true);
#endif
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
Log: Fixed icon flickering issue during loading by enabling retainWhileLoading property
Influence:
fix: 为 DQuickDciIconImage 设置 retainWhileLoading 为 true
Log: 通过启用 retainWhileLoading 属性修复图标加载时的闪烁问题
Influence:
PMS: BUG-346973
Summary by Sourcery
Bug Fixes: