Repository navigation
chore: replace Qt keywords with macros (QT_NO_KEYWORDS) - #591
18202781743 wants to merge 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces Qt keywords with Q_* macro equivalents and enables QT_NO_KEYWORDS in the build, using target/source-level exceptions to avoid breaking vendored code; test coverage is updated accordingly and SPDX metadata is added to the top-level CMake file. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
d526f81 to
85b9498
Compare
Log: 1. Replace emit/signals:/slots: with Q_EMIT/Q_SIGNALS:/Q_SLOTS: in all source and test files 2. Add QT_NO_KEYWORDS compile definition in CMake to enforce macro-only usage 3. Vendored third-party directories are not modified Influence: 1. All affected files now use Qt macro equivalents, compatible with projects defining QT_NO_KEYWORDS 2. No functional changes, mechanical keyword replacement only chore: 替换 Qt 关键字为宏形式(QT_NO_KEYWORDS) Log: 1. 将所有源文件和测试文件中的 emit/signals:/slots: 替换为 Q_EMIT/Q_SIGNALS:/Q_SLOTS: 2. 在 CMake 中添加 QT_NO_KEYWORDS 编译定义,强制使用宏形式 3. 不修改 vendored 第三方目录 Influence: 1. 所有受影响文件使用 Qt 宏等价形式,兼容定义了 QT_NO_KEYWORDS 的项目 2. 无功能变更,仅为机械性关键字替换
85b9498 to
91ec130
Compare
审查结论阻塞:CI 已复现编译失败。 顶层启用 代表位置: 请将这些位置改为 range-for 或 |
1. Replace all occurrences of the deprecated Qt `foreach` macro with `Q_FOREACH` in qdbusxml2cpp.cpp 2. The `foreach` macro is a Qt keyword that can conflict with other libraries and is not recommended in modern Qt code 3. `Q_FOREACH` is the preferred macro form that avoids namespace pollution and keyword conflicts 4. Changes affect loop iterations in classNameForInterface, writeProxy, and writeAdaptor functions Influence: 1. Verify qdbusxml2cpp tool generates correct proxy and adaptor code 2. Test XML introspection file processing with multiple interfaces, methods, signals, and properties 3. Confirm generated header and source files compile correctly 4. Validate that include handling and class name generation work as expected 5. Test edge cases such as empty interface lists and deprecated annotations 6. Ensure no behavioral changes in the generated output compared to previous version fix: 将 Qt foreach 替换为 Q_FOREACH 1. 在 qdbusxml2cpp.cpp 中将所有已弃用的 Qt `foreach` 宏替换为 `Q_FOREACH` 2. `foreach` 宏是 Qt 关键字,可能与其他库冲突,在现代 Qt 代码中不推荐 使用 3. `Q_FOREACH` 是首选的宏形式,可避免命名空间污染和关键字冲突 4. 更改影响 classNameForInterface、writeProxy 和 writeAdaptor 函数中的循 环迭代 Influence: 1. 验证 qdbusxml2cpp 工具能正确生成代理和适配器代码 2. 测试 XML 内省文件处理,涵盖多个接口、方法、信号和属性 3. 确认生成的头部和源文件能正确编译 4. 验证 include 处理和类名生成按预期工作 5. 测试空接口列表和弃用注解等边界情况 6. 确保生成输出与之前版本相比无行为变化
|
已补充提交 验证:本地 |
Description
Replace Qt keywords with macro equivalents to prevent naming conflicts with third-party libraries:
emit→Q_EMITsignals:→Q_SIGNALS:slots:→Q_SLOTS:Add
QT_NO_KEYWORDScompile definition in CMake to enforce macro-only usage.Notes
3rdparty/,libqt5xcbqpa-dev/,libqt6xcbqpa-dev/,qtwayland-dev/) are NOT modifieddde-qtintegrationanddde-qtplatform-pluginsuse per-targettarget_compile_definitionsinstead of globaladd_compile_definitionsto protect vendored codeset_source_files_properties(... COMPILE_FLAGS -UQT_NO_KEYWORDS)Issue: DDE-499
Summary by Sourcery
Adopt Qt macro equivalents throughout the project to prevent naming conflicts with third-party libraries.
Enhancements:
Build:
Chores: