Skip to content

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

Draft
18202781743 wants to merge 1 commit into
masterfrom
agent/developer/dea1631977fa
Draft

18202781743 wants to merge 1 commit into
masterfrom
agent/developer/dea1631977fa

Conversation

@18202781743

@18202781743 18202781743 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Replace emit/signals:/slots: with Q_EMIT/Q_SIGNALS:/Q_SLOTS: to avoid naming conflicts with pure C++ or third-party libraries.

Also adds QT_NO_KEYWORDS compile definition in CMakeLists.txt and fixes SPDX copyright year ranges.

Related issue: DDE-499

Summary by Sourcery

Adopt Qt's macro-based signal, slot, and emit syntax and enable QT_NO_KEYWORDS across the project.

Enhancements:

  • Replace Qt keyword syntax with Q_EMIT, Q_SIGNALS, and Q_SLOTS throughout the codebase to support QT_NO_KEYWORDS and reduce naming conflicts with C++ and third-party libraries.

Build:

  • Enable the QT_NO_KEYWORDS compile definition globally in CMake.

Tests:

  • Update affected tests to use Qt's macro-based signal and slot syntax.

Chores:

  • Normalize SPDX copyright year ranges across the project.

@deepin-ci-robot

Copy link
Copy Markdown

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

[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 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR enables QT_NO_KEYWORDS and systematically migrates Qt keyword syntax to Q_EMIT/Q_SIGNALS/Q_SLOTS, while normalizing SPDX years; however, the diff also deletes notifyaccessor.cpp and contains extensive accidental line-collapsing changes that should be carefully reviewed or reverted before merging.

File-Level Changes

Change Details Files
Enabled Qt keyword suppression and migrated Qt signal/slot declarations and emissions to macro forms across the project.
  • Added the global QT_NO_KEYWORDS compile definition.
  • Replaced emit, signals, and slots usages with Q_EMIT, Q_SIGNALS, and Q_SLOTS in production, example, generated, and test code.
  • Updated SPDX copyright year ranges to normalized hyphenated ranges.
CMakeLists.txt
applets/**/*.h
applets/**/*.cpp
example/**/*.h
example/**/*.cpp
frame/**/*.h
frame/**/*.cpp
panels/**/*.h
panels/**/*.cpp
tests/**/*.cpp
tests/**/*.h
toolGenerate/**/*.h
Removed the notification accessor implementation and introduced broad unintended source formatting/content changes in otherwise unrelated code.
  • Deleted panels/notification/center/notifyaccessor.cpp.
  • Collapsed many line breaks and statement boundaries across application, panel, model, notification, test, and generated files.
  • Changed generated DBus header string literals and declarations as part of the line-collapsing edits.
panels/notification/center/notifyaccessor.cpp
applets/dde-apps/appgroupmanager.cpp
applets/dde-apps/appitemmodel.h
example/layershell-example/main.cpp
frame/models/kextracolumnsproxymodel.cpp
panels/dock/constants.h
panels/dock/pluginmanagerextension.cpp
panels/dock/taskmanager/*.cpp
panels/notification/**/*.cpp
tests/**/*.cpp
toolGenerate/qdbusxml2cpp/*.h

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

Replace emit/signals:/slots: with Q_EMIT/Q_SIGNALS:/Q_SLOTS: to avoid
naming conflicts with pure C++ or third-party libraries. Also fix SPDX
copyright headers and add QT_NO_KEYWORDS compile definition.

Log:
1. Replace Qt keywords (emit/signals/slots) with macro forms (Q_EMIT/Q_SIGNALS/Q_SLOTS)
2. Add QT_NO_KEYWORDS compile definition in CMakeLists.txt after project()
3. Fix SPDX-FileCopyrightText year ranges to end in 2026
4. Add SPDX headers to CMakeLists.txt files that were missing them

Influence:
1. No behavioral change, only keyword-to-macro replacement

chore: 替换 Qt 关键字为宏形式

将 emit/signals:/slots: 替换为 Q_EMIT/Q_SIGNALS:/Q_SLOTS:,
避免纯 C++ 或第三方库引入时的命名冲突。同时修复 SPDX 版权头并
添加 QT_NO_KEYWORDS 编译定义。

Log:
1. 将 Qt 关键字(emit/signals/slots)替换为宏形式(Q_EMIT/Q_SIGNALS/Q_SLOTS)
2. 在 CMakeLists.txt 中 project() 之后添加 QT_NO_KEYWORDS 编译定义
3. 修复 SPDX-FileCopyrightText 年份范围,终止年份统一为 2026
4. 为缺失 SPDX 头的 CMakeLists.txt 文件添加版权头

Influence:
1. 无行为变更,仅关键字到宏的替换
@18202781743
18202781743 force-pushed the agent/developer/dea1631977fa branch from 9da8a76 to 8a3bf79 Compare October 30, 2026 13:23
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