Skip to content
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

fix: wrong status of switch button #608

Closed
wants to merge 1 commit into from
Closed

Conversation

FeiWang1119
Copy link
Contributor

correct the wrong initial status of switch button

Bug: https://pms.uniontech.com/bug-view-276221.html
Log:

correct the wrong initial status of switch button

Bug: https://pms.uniontech.com/bug-view-276221.html
Log:
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • paintEvent函数中添加了对isChecked()的检查,确保了在绘制开关按钮时,checked状态是最新的。
  • 使用DDciIcon::fromTheme方法动态获取图标,这样可以避免硬编码图标字符串,提高代码的可维护性。
  • 添加了checkedChanged信号的发射,以便在开关状态改变时触发相关的槽函数。

是否建议立即修改:

  • 否,提交的代码没有明显的语法错误或逻辑问题。
  • 是,建议添加一些注释来解释isChecked()方法返回的布尔值是如何被用来更新d->checked状态的,以及为什么需要发射checkedChanged信号。
  • 是,建议确保DDciIcon::fromTheme方法在所有情况下都能正确获取图标,以避免潜在的图标加载问题。
  • 是,建议添加一些单元测试来验证开关按钮的绘制逻辑,以确保在不同情况下都能正确工作。

deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Oct 8, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#608
@deepin-bot
Copy link
Contributor

deepin-bot bot commented Oct 8, 2024

Doc Check bot
🟢 Document Coverage Check Passed!

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: FeiWang1119, kegechen

The full list of commands accepted by this bot can be found here.

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

@FeiWang1119 FeiWang1119 closed this Oct 8, 2024
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