Skip to content

chore: replace Qt keywords with macros (QT_NO_KEYWORDS) - #739

Open
18202781743 wants to merge 1 commit into
masterfrom
agent/bot/c3e499a90052
Open

18202781743 wants to merge 1 commit into
masterfrom
agent/bot/c3e499a90052

Conversation

@18202781743

@18202781743 18202781743 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Replace Qt keywords with macro equivalents to prevent naming conflicts with third-party libraries:

  • emit → Q_EMIT
  • signals: → Q_SIGNALS:
  • slots: → Q_SLOTS:

Add QT_NO_KEYWORDS compile definition in CMake to enforce macro-only usage.

Notes

  • Vendored third-party directories (3rdparty/, libqt5xcbqpa-dev/, libqt6xcbqpa-dev/, qtwayland-dev/) are NOT modified
  • dde-qtintegration and dde-qtplatform-plugins use per-target target_compile_definitions instead of global add_compile_definitions to protect vendored code
  • Files including vendored headers with bare Qt keywords are protected with set_source_files_properties(... COMPILE_FLAGS -UQT_NO_KEYWORDS)

Issue: DDE-499

Summary by Sourcery

Enforce Qt macro-only keyword usage across the project to avoid conflicts with external libraries.

Enhancements:

  • Replace project Qt keyword usage with macro equivalents and enable QT_NO_KEYWORDS globally to prevent naming conflicts with third-party libraries.

Build:

  • Enable the QT_NO_KEYWORDS compile definition in CMake.

Tests:

  • Update unit-test signal declarations to use Q_SIGNALS.

Chores:

  • Add SPDX licensing metadata to the top-level CMake configuration and update affected source copyright notices.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[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.

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

@sourcery-ai

sourcery-ai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR enables QT_NO_KEYWORDS in the build and migrates the modified production and test code from Qt keyword syntax to Q_EMIT and Q_SIGNALS, avoiding conflicts with third-party libraries while leaving vendored code untouched.

File-Level Changes

Change Details Files
Enforce Qt keyword-free source usage through CMake and update affected project/test code to Qt macro equivalents.
  • Add the QT_NO_KEYWORDS compile definition at the top-level build configuration.
  • Replace signal emission with Q_EMIT.
  • Replace test signal sections with Q_SIGNALS.
CMakeLists.txt
src/dquickwindow.cpp
tests/ut_dblitframebuffernode.cpp
tests/ut_dblurimagenode.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@18202781743
18202781743 force-pushed the agent/bot/c3e499a90052 branch from 2c1bd1c to 68c4c76 Compare October 29, 2026 02:06
@18202781743
18202781743 marked this pull request as ready for review October 29, 2026 02:08
@18202781743 18202781743 changed the title feat: replace Qt keywords with macros (QT_NO_KEYWORDS) chore: replace Qt keywords with macros (QT_NO_KEYWORDS) Oct 29, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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. 无功能变更,仅为机械性关键字替换
@18202781743
18202781743 force-pushed the agent/bot/c3e499a90052 branch from 68c4c76 to e0dd298 Compare October 29, 2026 02:24

This branch has not been deployed

No deployments
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.

2 participants