Skip to content

Commit d5dbea1

Browse files
deepin-ci-robot18202781743
authored andcommitted
sync: from linuxdeepin/dtkdeclarative
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#519
1 parent 7716db8 commit d5dbea1

13 files changed

Lines changed: 102 additions & 18 deletions

examples/exhibition/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class Object : public QObject {
6161

6262
int main(int argc, char **argv)
6363
{
64+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
6465
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
66+
#endif
6567

6668
QGuiApplication app(argc, argv);
6769
app.setOrganizationName("deepin");

examples/qml-inspect/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
int main(int argc, char *argv[])
1111
{
12+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1213
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
14+
#endif
1315

1416
QGuiApplication app(argc, argv);
1517
app.setOrganizationName("deepin");

qt6/src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ qt_add_qml_module(${LIB_NAME}
2121

2222
dtk_extend_target(${LIB_NAME} EnableCov ${ENABLE_COV})
2323
dtk_extend_target(${PLUGIN_NAME} EnableCov ${ENABLE_COV})
24+
target_compile_definitions(${LIB_NAME} PRIVATE
25+
D_IGNORE_DEPRECATIONS
26+
)
2427

2528
qt_add_translations(${LIB_NAME}
2629
TS_FILES ${TS_FILES}

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ add_library(${LIB_NAME} SHARED
1717
)
1818

1919
dtk_extend_target(${LIB_NAME} EnableCov ${ENABLE_COV})
20+
target_compile_definitions(${LIB_NAME} PRIVATE
21+
D_IGNORE_DEPRECATIONS
22+
)
2023

2124
set_target_properties(${LIB_NAME} PROPERTIES
2225
VERSION ${CMAKE_PROJECT_VERSION}

src/dapploader.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Q_LOGGING_CATEGORY(appLoaderLog, "dtk.quick.apploader");
4040
static const QQuickItemPrivate::ChangeTypes changedTypes = QQuickItemPrivate::Geometry;
4141
DAppLoader *DAppLoader::self = nullptr;
4242

43-
static inline const bool heightValid(QQuickItemPrivate *item)
43+
static inline bool heightValid(QQuickItemPrivate *item)
4444
{
4545
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
4646
return item->heightValid;
@@ -246,7 +246,11 @@ bool DAppLoaderPrivate::createObjects(const char *propertyName)
246246
void DAppLoaderPrivate::createChildComponents()
247247
{
248248
auto components = appRootItem->findChildren<QQmlComponent *>(QStringLiteral(""), Qt::FindDirectChildrenOnly);
249+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
250+
for (auto childCom : std::as_const(components)) {
251+
#else
249252
for (auto childCom : qAsConst(components)) {
253+
#endif
250254
QObject::connect(childCom, SIGNAL(progressChanged(qreal)), q_func(), SLOT(_q_onComponentProgressChanged()));
251255
auto asyn = appRootItem->asynchronous() ? DQmlComponentIncubator::Asynchronous : DQmlComponentIncubator::AsynchronousIfNested;
252256
DQmlComponentIncubator *incubator = new DQmlComponentIncubator(childCom, this, asyn);
@@ -436,7 +440,11 @@ void DAppLoaderPrivate::_q_onComponentProgressChanged()
436440
{
437441
qreal progress = 0;
438442
auto components = appRootItem->findChildren<QQmlComponent *>();
443+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
444+
for (auto childCom : std::as_const(components) {
445+
#else
439446
for (auto childCom : qAsConst(components)) {
447+
#endif
440448
progress += childCom->progress();
441449
}
442450

src/dquickwindow.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ void DQuickWindowAttachedPrivate::_q_updateBlurAreaForWindow()
226226
QList<QPainterPath> blurPathList;
227227
QVector<DPlatformHandle::WMBlurArea> blurAreaList;
228228

229+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
230+
for (const DQuickBehindWindowBlur *blur : std::as_const(blurList)) {
231+
#else
229232
for (const DQuickBehindWindowBlur *blur : qAsConst(blurList)) {
233+
#endif
230234
if (!blur->d_func()->isValidBlur())
231235
continue;
232236

@@ -244,7 +248,11 @@ void DQuickWindowAttachedPrivate::_q_updateBlurAreaForWindow()
244248
blurSuc = q->setWindowBlurAreaByWM(blurAreaList);
245249
} else {
246250
// convert to QPainterPath
251+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
252+
for (const DPlatformHandle::WMBlurArea &area : std::as_const(blurAreaList)) {
253+
#else
247254
for (const DPlatformHandle::WMBlurArea &area : qAsConst(blurAreaList)) {
255+
#endif
248256
QPainterPath path;
249257
path.addRoundedRect(area.x, area.y, area.width, area.height, area.xRadius, area.yRaduis);
250258
blurPathList << path;
@@ -343,7 +351,7 @@ bool DQuickWindowAttached::isEnabled() const
343351
{
344352
D_DC(DQuickWindowAttached);
345353
return d->handle && (DPlatformHandle::isEnabledDXcb(window())
346-
|| DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::IsTreelandPlatform));
354+
|| DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::IsWaylandPlatform));
347355
}
348356

349357
/*!

src/private/dbackdropnode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class Q_DECL_HIDDEN DataManager : public DataManagerBase
145145
}
146146

147147
static DataManagerPointer<Derive> resolve(const DataManagerPointer<Derive> &other, QQuickWindow *owner) {
148-
static_assert(&Derive::metaObject);
149148
Q_ASSERT(owner);
150149
if (other && other->owner() == owner)
151150
return other;
@@ -828,7 +827,6 @@ class Q_DECL_HIDDEN RhiNode : public DBackdropNode {
828827
texture->data->pixelSize().height() / float(m_rect.height() * devicePixelRatio)});
829828
rhi->render(renderData->rt.get());
830829
} else {
831-
auto rhi = this->rhi->rhi();
832830
QPointF sourcePos = renderMatrix.map(m_rect.topLeft()) * devicePixelRatio;
833831

834832
if (ct) {

src/private/dquickcontrolpalette.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,11 @@ void DQuickControlColorSelector::findAndSetControlParent()
344344
{
345345
QQuickItem *parentItem = qobject_cast<QQuickItem*>(parent());
346346
Q_ASSERT(parentItem);
347+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
347348
for (const QMetaObject::Connection &conn : qAsConst(m_itemParentChangeConnections)) {
349+
#else
350+
for (const QMetaObject::Connection &conn : std::as_const(m_itemParentChangeConnections)) {
351+
#endif
348352
disconnect(conn);
349353
}
350354
m_itemParentChangeConnections.clear();
@@ -1028,7 +1032,11 @@ void DQuickControlColorSelector::recvPaletteColorChanged()
10281032
auto palette = qobject_cast<DQuickControlPalette*>(sender());
10291033
Q_ASSERT(palette);
10301034
// Maybe the multiple properties is use a same palette.
1035+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1036+
for (const auto &i : std::as_const(m_palettes)) {
1037+
#else
10311038
for (const auto &i : qAsConst(m_palettes)) {
1039+
#endif
10321040
if (i.second != palette)
10331041
continue;
10341042
updatePropertyFromName(i.first, palette);
@@ -1040,7 +1048,11 @@ void DQuickControlColorSelector::onPaletteDestroyed()
10401048
auto palette = sender();
10411049
Q_ASSERT(palette);
10421050
// Maybe the multiple properties is use a same palette.
1051+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1052+
for (const auto &i : std::as_const(m_palettes)) {
1053+
#else
10431054
for (const auto &i : qAsConst(m_palettes)) {
1055+
#endif
10441056
if (i.second != palette)
10451057
continue;
10461058
setPalette(i.first, nullptr);

src/private/dquickimageprovider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ static QPainterPath roundedRectPath(const QRectF &rect, const DQuickShadowProvid
432432

433433
QImage DQuickShadowProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
434434
{
435+
Q_UNUSED(requestedSize)
435436
ShadowConfig config;
436437
QColor color;
437438
qreal xOffset;

src/private/dquickwaterprogressattribute_p.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class WaterPopAttribute : public QObject
5656

5757
qreal sizeRatio() const;
5858

59-
inline qreal yOffset() const;
60-
inline void setYOffset(qreal offset);
59+
qreal yOffset() const;
60+
void setYOffset(qreal offset);
6161

6262
Q_SIGNALS:
6363
void xSpeedChanged();

0 commit comments

Comments
 (0)