build: enable Qt6 build and raise unit test coverage above 80% - #547
Merged
pengfeixx merged 1 commit intoJul 6, 2026
Merged
Conversation
Fix Qt6 detection in CMake on systems with both Qt5 and Qt6 installed, and add test cases for groupconfigoptdlg and titlebar to lift overall unit test coverage from 79% to 80.3%. 修复Qt5/Qt6共存环境下CMake错误选中Qt5的问题,并补充groupconfigoptdlg 与titlebar的单元测试,将整体覆盖率从79%提升至80.3%。 Log: 修复Qt6探测并提升单测覆盖率至80%以上 Influence: 项目可在Qt5/Qt6共存环境下正确构建并链接Qt6,单元测试覆盖率提升至80.3%。
Reviewer's GuideThis PR fixes Qt version detection in CMake to reliably prefer Qt6 in mixed Qt5/Qt6 environments and adds new unit tests for the TitleBar mouse handling and GroupConfigOptDlg dialog flows to raise overall coverage above 80%. Flow diagram for updated Qt version detection in CMakeflowchart TD
A[Start CMake configure] --> B[find_package Qt6 QUIET COMPONENTS Core]
B --> C{Qt6_FOUND}
C -->|yes| D[set QT_VERSION_MAJOR 6]
C -->|no| E[find_package Qt5 REQUIRED COMPONENTS Core]
E --> F[set QT_VERSION_MAJOR 5]
D --> G[Configure project with Qt6]
F --> H[Configure project with Qt5]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new TitleBar MouseEvents test only asserts widget visibility; consider adding checks on cursor shape or window resizing behavior to verify that the different mouse event branches are not only executed but also behave as expected.
- In UT_GroupConfigOptDlg_Test::themeChange, QSignalSpy::wait() is unnecessary since you emit themeTypeChanged synchronously; you could drop the wait and instead assert on the dialog’s visual or state changes to better validate the theme handling logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new TitleBar MouseEvents test only asserts widget visibility; consider adding checks on cursor shape or window resizing behavior to verify that the different mouse event branches are not only executed but also behave as expected.
- In UT_GroupConfigOptDlg_Test::themeChange, QSignalSpy::wait() is unnecessary since you emit themeTypeChanged synchronously; you could drop the wait and instead assert on the dialog’s visual or state changes to better validate the theme handling logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
lzwind
approved these changes
Jul 6, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Qt6 detection in CMake on systems with both Qt5 and Qt6 installed, and add test cases for groupconfigoptdlg and titlebar to lift overall unit test coverage from 79% to 80.3%.
修复Qt5/Qt6共存环境下CMake错误选中Qt5的问题,并补充groupconfigoptdlg 与titlebar的单元测试,将整体覆盖率从79%提升至80.3%。
Log: 修复Qt6探测并提升单测覆盖率至80%以上
Influence: 项目可在Qt5/Qt6共存环境下正确构建并链接Qt6,单元测试覆盖率提升至80.3%。
Summary by Sourcery
Improve Qt version detection to prefer Qt6 in mixed Qt5/Qt6 environments and expand unit tests to raise coverage above 80%.
Build:
Tests: