Skip to content

fix: rename QML value type NetType to netType to silence Qt6 naming warning - #605

Merged
deepin-bot[bot] merged 1 commit into
masterfrom
agent/bot/ddc5f9eb
Sep 3, 2026
Merged

fix: rename QML value type NetType to netType to silence Qt6 naming warning#605
deepin-bot[bot] merged 1 commit into
masterfrom
agent/bot/ddc5f9eb

Conversation

@52cyb

@52cyb 52cyb commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fix: Invalid QML element name "NetType" warning

Fixes the runtime warning:

[qt.qml.typeregistration] <> Invalid QML element name "NetType"; value type names should begin with a lowercase letter

Root cause

NetType is declared as a Q_GADGET class (an enum container, never instantiated) in net-view/operation/nettype.h. In Qt6, Q_GADGET types are registered as value types, and value type names must begin with a lowercase letter. It was registered with an uppercase name "NetType" in dcc-network/operation/dccnetwork.cpp:32, triggering the warning.

Changes

  • dcc-network/operation/dccnetwork.cpp:32: changed the 4th argument of qmlRegisterType<NetType>(...) from "NetType" to "netType" (the C++ template parameter <NetType> is unchanged).
  • dcc-network/qml/: updated 101 NetType. references to netType. across 15 QML files (enum value accesses only; import org.deepin.dcc.network 1.0 URIs unchanged).
  • The C++ class name NetType and all NetType:: enum references remain unchanged — only the QML element name is renamed.

Total: 16 files changed, 99 insertions(+), 99 deletions(-).

Verification (already passed)

  • Code review: 98/100, 0 vulnerabilities, 4 checks all passed.
  • Local build: UOS V25 / pbuilder (chroot isolated), build completed successfully. Invalid QML warnings: 0 (target warning eliminated). 6 binary deb packages generated normally.

Multica issue

DDE-148: dde-network-core: QML 类型注册警告 NetType 值类型名应以小写字母开头

Summary by Sourcery

Bug Fixes:

  • Rename the QML-registered NetType value type to lowercase and update all enum references to eliminate the Qt 6 invalid QML element warning.

@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

@sourcery-ai

sourcery-ai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

Renames the Qt6-registered NetType QML value type to netType and updates its enum references across the network QML pages, preserving the C++ API and module URI while removing the invalid-element-name warning.

File-Level Changes

Change Details Files
Renamed the registered QML value type to comply with Qt6 lowercase naming requirements.
  • Changed the QML registration name from NetType to netType while retaining the C++ class and enum identifiers.
  • Updated all QML enum-value references to use netType. without changing the module URI or other registered types.
dcc-network/operation/dccnetwork.cpp
dcc-network/qml/DeviceStatusItem.qml
dcc-network/qml/NetworkMain.qml
dcc-network/qml/PageDSL.qml
dcc-network/qml/PageDSLSettings.qml
dcc-network/qml/PageSettings.qml
dcc-network/qml/PageSystemProxy.qml
dcc-network/qml/PageVPN.qml
dcc-network/qml/PageVPNSettings.qml
dcc-network/qml/PageWiredDevice.qml
dcc-network/qml/PageWirelessDevice.qml
dcc-network/qml/SectionDevice.qml
dcc-network/qml/SectionGeneric.qml
dcc-network/qml/SectionIPv4.qml
dcc-network/qml/SectionIPv6.qml
dcc-network/qml/SectionSecret.qml
Verified the rename eliminates the runtime warning without affecting the build.
  • Confirmed the isolated local build completed successfully and produced the expected packages.
  • Confirmed invalid QML warnings were reduced to zero.
dcc-network/operation/dccnetwork.cpp
dcc-network/qml/

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

@52cyb
52cyb force-pushed the agent/bot/ddc5f9eb branch 2 times, most recently from 4680673 to e83656f Compare September 2, 2026 10:03
@52cyb
52cyb marked this pull request as ready for review September 3, 2026 02:07
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb, caixr23

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 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 ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

1. Rename QML value type registration "NetType" to "netType" in dccnetwork.cpp to satisfy Qt6 value type naming convention
2. Update 101 NetType. references to netType. across 15 QML files
3. Keep C++ class name NetType and all NetType:: enum references unchanged

Influence:
1. Verify no "Invalid QML element name" warning at runtime
2. Confirm network control center QML pages load and display correctly
3. Check NetType enum values resolve correctly in QML

fix: 将 QML NetType 注册名改为 netType

1. 将 dccnetwork.cpp 中 QML 值类型注册名 "NetType" 改为 "netType",符合 Qt6 值类型命名约定
2. 更新 15 个 QML 文件中 101 处 NetType. 引用为 netType.
3. C++ 类名 NetType 及所有 NetType:: 枚举引用保持不变

Influence:
1. 验证运行时不再出现 "Invalid QML element name" 警告
2. 确认控制中心网络 QML 页面加载和显示正常
3. 检查 QML 中 NetType 枚举值解析正确
@52cyb
52cyb force-pushed the agent/bot/ddc5f9eb branch from e83656f to 46309af Compare September 3, 2026 02:12
@52cyb

52cyb commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 46dab22 into master Sep 3, 2026
24 of 26 checks passed
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.

3 participants