-
Notifications
You must be signed in to change notification settings - Fork 40
build: conditionally disable driver features for Qt6 builds #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
[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 |
|
/merge |
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: