Skip to content

feat: support Qt 6.10#537

Merged
ComixHe merged 1 commit into
linuxdeepin:masterfrom
ComixHe:master
Oct 13, 2025
Merged

feat: support Qt 6.10#537
ComixHe merged 1 commit into
linuxdeepin:masterfrom
ComixHe:master

Conversation

@ComixHe

@ComixHe ComixHe commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: ComixHe <heyuming@deepin.org>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @ComixHe, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@ComixHe ComixHe requested a review from 18202781743 October 13, 2025 07:40
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 13, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#537
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

代码审查报告

总体评价

这次代码变更主要是针对Qt6版本的支持更新,特别是在Qt 6.10.0版本上的一些调整。代码整体结构清晰,但有一些可以改进的地方。

具体改进建议

1. CMakeLists.txt 文件

优点

  • 统一了Qt6版本的条件判断逻辑
  • 添加了对Qt 6.10.0新特性的支持

改进建议

  • 在多个CMakeLists.txt文件中重复出现了类似的Qt6版本判断逻辑,建议提取为一个公共的CMake函数或宏,避免代码重复
  • 在qt6/src/qml/settings/CMakeLists.txt中,find_package(Qt6 ...)的调用应该与其他文件保持一致的缩进风格
  • 在chameleon/CMakeLists.txt中,find_package(Qt6 ...)的参数格式化不一致,建议统一格式

2. 代码格式和风格

改进建议

  • 在examples/exhibition/CMakeLists.txt中,多余的空格应该删除(如${CMAKE_CURRENT_LIST_DIR}/main.cpp
  • 在tests/ut_dqmlglobalobject.cpp中,将构造函数调用从圆括号()改为花括号{}是好的改进,提高了代码的一致性

3. 安全性考虑

建议

  • 在检查Qt版本时,建议使用VERSION_GREATER_EQUAL的同时也检查VERSION_LESS,以确保版本号在合理范围内
  • 在find_package调用中,应该考虑添加QUIET参数以避免不必要的警告信息

4. 性能考虑

建议

  • 在多个地方重复检查Qt版本,可以考虑在项目顶层CMake文件中预先计算并存储这些条件,避免重复计算
  • 对于Qt6的private模块,只在确实需要时才查找,而不是无条件查找

5. 错误处理

建议

  • 在find_package调用失败时,应该提供更明确的错误信息,帮助开发者快速定位问题
  • 对于Qt6的private模块查找,应该添加适当的错误处理,因为这些模块可能在某些Qt版本中不可用

总结

这次代码更新主要是为了支持Qt6的新特性,整体方向是正确的。主要改进点集中在:

  1. 减少重复代码,提高代码复用性
  2. 统一代码风格,提高可读性
  3. 增强错误处理和版本检查的健壮性
  4. 优化性能,避免不必要的计算

这些改进将使代码更易于维护,并且能更好地适应未来Qt版本的更新。

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, ComixHe

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ComixHe ComixHe merged commit ebe2e86 into linuxdeepin:master Oct 13, 2025
19 of 20 checks passed
ComixHe pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 13, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#537
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants