build: conditionally disable driver features for Qt6 builds#578
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Dec 3, 2025
Merged
build: conditionally disable driver features for Qt6 builds#578deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Add DISABLE_DRIVER macro definition when building with Qt6 to ensure compatibility. The macro conditionally hides driver management buttons in the main window title bar, as driver functionality is not supported in Qt6 builds while maintaining full functionality for Qt5 builds.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConditionally defines a DISABLE_DRIVER macro for Qt6 builds and updates the main window title bar logic to hide the driver-related button box only when appropriate (Qt6 or specific board vendor), instead of always hiding it. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这段代码变更进行审查:
建议:
总体来说,这是一个合理的代码变更,通过条件编译来适配不同 Qt 版本的需求,代码结构清晰,逻辑正确。 |
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The CMake condition
if(${QT_VERSION_MAJOR} EQUAL 6)would be more robust written without dereferencing in theif(e.g.if(QT_VERSION_MAJOR EQUAL 6)or with quotes) to avoid issues when the variable is unset or contains unexpected content. - Using
add_definitions(-DDISABLE_DRIVER)applies the macro project‑wide; consider switching totarget_compile_definitionson the specific targets that need this behavior to avoid unintended side effects on other targets. - The changes in
initWindowTitle()now showmp_ButtonBoxon Qt5 whenboardVendorType()is empty, whereas it was always hidden before; double‑check that this UI behavior change (hardware/driver buttons becoming visible in that case) is intended, or separate the driver controls from other title bar elements if only some parts should be gated byDISABLE_DRIVER.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The CMake condition `if(${QT_VERSION_MAJOR} EQUAL 6)` would be more robust written without dereferencing in the `if` (e.g. `if(QT_VERSION_MAJOR EQUAL 6)` or with quotes) to avoid issues when the variable is unset or contains unexpected content.
- Using `add_definitions(-DDISABLE_DRIVER)` applies the macro project‑wide; consider switching to `target_compile_definitions` on the specific targets that need this behavior to avoid unintended side effects on other targets.
- The changes in `initWindowTitle()` now show `mp_ButtonBox` on Qt5 when `boardVendorType()` is empty, whereas it was always hidden before; double‑check that this UI behavior change (hardware/driver buttons becoming visible in that case) is intended, or separate the driver controls from other title bar elements if only some parts should be gated by `DISABLE_DRIVER`.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
Dec 3, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
Contributor
Author
|
/merge |
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.
Add DISABLE_DRIVER macro definition when building with Qt6 to ensure compatibility. The macro conditionally hides driver management buttons in the main window title bar, as driver functionality is not supported in Qt6 builds while maintaining full functionality for Qt5 builds.
Summary by Sourcery
Conditionally disable driver-related UI elements in Qt6 builds while preserving existing behavior for Qt5 builds.
Enhancements:
Build: