deepin-kwin icon indicating copy to clipboard operation
deepin-kwin copied to clipboard

fix: compatibility with Qt 6.10

Open felixonmars opened this issue 1 month ago • 2 comments

Credits to Antonio Rojas from Arch Linux.

felixonmars avatar Oct 14 '25 16:10 felixonmars

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: felixonmars

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

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

deepin-ci-robot avatar Oct 14 '25 16:10 deepin-ci-robot

deepin pr auto review

我来分析这段代码变更:

  1. CMakeLists.txt 的变更:
  • 添加了对 Qt 6.10 及以上版本的私有模块支持
  • 使用 VERSION_GREATER_EQUAL 来检查版本,这是一个很好的做法,因为它明确表达了版本比较的意图
  • 建议改进:可以添加注释说明为什么需要这些私有模块,以及它们的具体用途,这样有助于后续维护
  1. integration.cpp 的变更:
  • 添加了版本检查条件编译,针对 Qt 6.10 及以上版本使用不同的头文件
  • qgenericunixthemes_p.h 改为 qgenericunixtheme_p.h(注意文件名少了一个 's')
  • 使用 QT_VERSION_CHECK 进行版本检查,这是标准的 Qt 版本检查方式
  • 建议改进:
    1. 可以添加注释说明为什么在 Qt 6.10 版本需要使用不同的头文件
    2. 建议在条件编译块内也添加适当的注释,说明不同版本的处理差异
  1. 总体建议:
  • 这两个变更是一致的,都是为了适配 Qt 6.10 版本的变化
  • 建议在代码变更的提交信息中明确说明这是为了适配 Qt 6.10 版本
  • 考虑添加测试用例来验证这两个变更的正确性,特别是在不同 Qt 版本下的表现
  1. 安全性考虑:
  • 版本检查使用了正确的宏定义,不存在安全风险
  • 私有模块的使用需要谨慎,因为 Qt 的私有 API 可能在未来版本中发生变化

这些变更看起来是为了适配 Qt 6.10 版本中头文件名称的变化,整体变更合理且必要。建议在代码中添加适当的注释以提高可维护性。

deepin-ci-robot avatar Oct 14 '25 16:10 deepin-ci-robot