Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkdeclarative
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#426
  • Loading branch information
deepin-ci-robot authored and 18202781743 committed Dec 3, 2024
1 parent 45baf68 commit 17eaba0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chameleon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ endif()
if(EnableQt6)
qt_add_qml_module(${PLUGIN_NAME}
URI "Chameleon"
VERSION "${PROJECT_VERSION}"
VERSION "1.0"
CLASS_NAME QtQuickControls2ChameleonStylePlugin
PLUGIN_TARGET ${PLUGIN_NAME}
OUTPUT_DIRECTORY
Expand Down
17 changes: 17 additions & 0 deletions src/private/dquickdciiconimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ DQuickDciIconImagePrivate::DQuickDciIconImagePrivate(DQuickDciIconImage *qq)
QObject::connect(imageItem, &DQuickIconImage::nameChanged, qq, &DQuickDciIconImage::nameChanged);
QObject::connect(imageItem, &DQuickIconImage::asynchronousChanged, qq, &DQuickDciIconImage::asynchronousChanged);
QObject::connect(imageItem, &DQuickIconImage::cacheChanged, qq, &DQuickDciIconImage::cacheChanged);
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
QObject::connect(imageItem, &DQuickIconImage::retainWhileLoadingChanged, qq, &DQuickDciIconImage::retainWhileLoadingChanged);
#endif
}

void DQuickDciIconImagePrivate::layout()
Expand Down Expand Up @@ -333,6 +336,20 @@ void DQuickDciIconImage::setAsynchronous(bool async)
d->imageItem->setAsynchronous(async);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
bool DQuickDciIconImage::retainWhileLoading() const
{
D_DC(DQuickDciIconImage);
return d->imageItem->retainWhileLoading();
}

void DQuickDciIconImage::setRetainWhileLoading(bool retain)
{
D_D(DQuickDciIconImage);
d->imageItem->setRetainWhileLoading(retain);
}
#endif

bool DQuickDciIconImage::cache() const
{
D_DC(DQuickDciIconImage);
Expand Down
12 changes: 12 additions & 0 deletions src/private/dquickdciiconimage_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class DQuickDciIconImage : public QQuickItem, DCORE_NAMESPACE::DObject
Q_PROPERTY(bool fallbackToQIcon READ fallbackToQIcon WRITE setFallbackToQIcon NOTIFY fallbackToQIconChanged)
Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
Q_PROPERTY(bool cache READ cache WRITE setCache NOTIFY cacheChanged FINAL)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
Q_PROPERTY(bool retainWhileLoading READ retainWhileLoading WRITE setRetainWhileLoading NOTIFY retainWhileLoadingChanged)
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QML_NAMED_ELEMENT(DciIcon)
QML_ATTACHED(DQuickIconAttached)
Expand Down Expand Up @@ -69,6 +72,11 @@ class DQuickDciIconImage : public QQuickItem, DCORE_NAMESPACE::DObject
bool cache() const;
void setCache(bool cache);

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
bool retainWhileLoading() const;
void setRetainWhileLoading(bool retain);
#endif

DQuickIconImage *imageItem() const;

static bool isNull(const QString &iconName);
Expand All @@ -85,6 +93,10 @@ class DQuickDciIconImage : public QQuickItem, DCORE_NAMESPACE::DObject
void asynchronousChanged();
void cacheChanged();

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
void retainWhileLoadingChanged();
#endif

protected:
void classBegin() override;
void componentComplete() override;
Expand Down

0 comments on commit 17eaba0

Please sign in to comment.