Skip to content

Conversation

@Kakueeen
Copy link
Contributor

  1. Added automatic Qt version detection in CMakeLists.txt to support
    both Qt5 and Qt6
  2. Modified CMake configuration to use dynamic Qt version variables
    instead of hardcoded Qt6
  3. Updated debian/control to include Qt5 package alternatives for build
    dependencies
  4. Enhanced debian/rules to detect available Qt version and set
    appropriate QT_DIR
  5. This change allows the project to build on systems with either Qt5 or
    Qt6 installed

Log: Added support for both Qt5 and Qt6 versions

Influence:

  1. Test building on systems with only Qt5 installed
  2. Test building on systems with only Qt6 installed
  3. Verify application functionality on both Qt5 and Qt6 environments
  4. Check that all UI components render correctly in both versions
  5. Test device formatting functionality remains consistent across Qt
    versions

feat: 添加 Qt5 和 Qt6 双版本支持

  1. 在 CMakeLists.txt 中添加自动 Qt 版本检测,支持 Qt5 和 Qt6
  2. 修改 CMake 配置使用动态 Qt 版本变量替代硬编码的 Qt6
  3. 更新 debian/control 包含 Qt5 包替代方案用于构建依赖
  4. 增强 debian/rules 以检测可用 Qt 版本并设置合适的 QT_DIR
  5. 此更改允许项目在安装 Qt5 或 Qt6 的系统上构建

Log: 新增对 Qt5 和 Qt6 双版本的支持

Influence:

  1. 在仅安装 Qt5 的系统上测试构建
  2. 在仅安装 Qt6 的系统上测试构建
  3. 验证应用在 Qt5 和 Qt6 环境下的功能
  4. 检查所有 UI 组件在两个版本中是否正确渲染
  5. 测试设备格式化功能在 Qt 版本间保持一致

TASK: https://pms.uniontech.com/task-view-383509.html

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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

Please try again later or upgrade to continue using Sourcery

@Kakueeen Kakueeen force-pushed the master branch 2 times, most recently from db3ffb2 to d888c2f Compare December 17, 2025 02:37
1. Added automatic Qt version detection in CMakeLists.txt to support
both Qt5 and Qt6
2. Modified CMake configuration to use dynamic Qt version variables
instead of hardcoded Qt6
3. Updated debian/control to include Qt5 package alternatives for build
dependencies
4. Enhanced debian/rules to detect available Qt version and set
appropriate QT_DIR
5. This change allows the project to build on systems with either Qt5 or
Qt6 installed

Log: Added support for both Qt5 and Qt6 versions

Influence:
1. Test building on systems with only Qt5 installed
2. Test building on systems with only Qt6 installed
3. Verify application functionality on both Qt5 and Qt6 environments
4. Check that all UI components render correctly in both versions
5. Test device formatting functionality remains consistent across Qt
versions

feat: 添加 Qt5 和 Qt6 双版本支持

1. 在 CMakeLists.txt 中添加自动 Qt 版本检测,支持 Qt5 和 Qt6
2. 修改 CMake 配置使用动态 Qt 版本变量替代硬编码的 Qt6
3. 更新 debian/control 包含 Qt5 包替代方案用于构建依赖
4. 增强 debian/rules 以检测可用 Qt 版本并设置合适的 QT_DIR
5. 此更改允许项目在安装 Qt5 或 Qt6 的系统上构建

Log: 新增对 Qt5 和 Qt6 双版本的支持

Influence:
1. 在仅安装 Qt5 的系统上测试构建
2. 在仅安装 Qt6 的系统上测试构建
3. 验证应用在 Qt5 和 Qt6 环境下的功能
4. 检查所有 UI 组件在两个版本中是否正确渲染
5. 测试设备格式化功能在 Qt 版本间保持一致

TASK: https://pms.uniontech.com/task-view-383509.html
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个diff进行代码审查,主要从以下几个方面分析:

  1. 语法逻辑:
  • 代码整体逻辑正确,通过条件判断来适配Qt5和Qt6版本
  • 使用了正确的CMake和Qt函数
  • 版本检查使用了正确的QT_VERSION_CHECK宏
  1. 代码质量:
  • 优点:
    • 代码结构清晰,有良好的注释说明
    • 使用了CMake的变量来管理依赖,提高了可维护性
    • 对Qt5和Qt6的适配处理得当
  • 可改进:
    • 在CMakeLists.txt中,DTK_VERSION_MAJOR的设置逻辑可以更清晰:
      if (QT_VERSION_MAJOR MATCHES 6)
          set(DTK_VERSION_MAJOR 6)
      else()
          set(DTK_VERSION_MAJOR "")  # 空字符串可能不够明确
      endif()
      建议改为:
      if (QT_VERSION_MAJOR MATCHES 6)
          set(DTK_VERSION_MAJOR 6)
      else()
          set(DTK_VERSION_MAJOR 5)  # 明确指定版本号
      endif()
  1. 代码性能:
  • Qt5的翻译文件处理使用了循环,可能比Qt6的批量处理略慢,但这是必要的兼容性处理
  • 使用了PkgConfig来管理依赖,这是较好的做法
  • target_link_libraries的链接方式合理
  1. 代码安全:
  • 使用了PRIVATE关键字限制链接范围,这是好的安全实践
  • 环境变量的处理安全
  • 文件路径处理使用了CMake的标准变量,避免了硬编码
  1. 其他建议:
  • debian/control文件中的依赖关系处理得当,使用"|"提供了备选方案
  • debian/rules中的Qt版本检测可以进一步优化,建议添加版本检测的错误处理
  • main.cpp中的条件编译处理合理,但可以考虑使用更现代的方式处理X11相关代码

总结:
这个diff主要实现了对Qt5和Qt6的兼容性支持,整体实现质量较高。主要改进点在于:

  1. DTK版本号的设置可以更明确
  2. 可以添加更多的错误处理机制
  3. 考虑使用更现代的方式处理X11相关代码

这些改进建议都是可选的,当前代码已经能够正常工作且具有良好的可维护性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Kakueeen, lzwind

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

@Kakueeen
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Dec 17, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit a3de818 into linuxdeepin:master Dec 17, 2025
17 of 18 checks passed
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