Skip to content

Commit 5279290

Browse files
committed
fix: set retainWhileLoading to true for DQuickDciIconImage
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
1 parent 6954d3d commit 5279290

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/private/dquickiconimage.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ qreal DQuickIconImagePrivate::calculateDevicePixelRatio() const
154154
}
155155

156156
DQuickIconImage::DQuickIconImage(QQuickItem *parent)
157-
: QQuickImage(*(new DQuickIconImagePrivate), parent)
157+
: DQuickIconImage(*(new DQuickIconImagePrivate), parent)
158158
{
159-
setAsynchronous(true); // asynchronous by default
159+
160160
}
161161

162162
DQuickIconImage::~DQuickIconImage()
@@ -341,6 +341,10 @@ DQuickIconImage::DQuickIconImage(DQuickIconImagePrivate &dd, QQuickItem *parent)
341341
: QQuickImage(dd, parent)
342342
{
343343
setAsynchronous(true);
344+
345+
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
346+
setRetainWhileLoading(true);
347+
#endif
344348
}
345349

346350
void DQuickIconImage::itemChange(ItemChange change, const ItemChangeData &value)

0 commit comments

Comments
 (0)