-
Notifications
You must be signed in to change notification settings - Fork 153
fix: tooltip does not show the latest text #725
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
base: master
Are you sure you want to change the base?
Conversation
在这paintEvent中判断文本是否发生变化,如果变化了则调用DToolTip::setShowToolTip(this, false)重置状态, 确保Tooltip能显示最新的文本内容。为此在DLabelPrivate中增加了lastText成员变量用于记录上一次的文本。 Check if the text has changed in paintEvent. If it has changed, call DToolTip::setShowToolTip(this, false) to reset the status, ensuring that the Tooltip displays the latest text content. To achieve this, a lastText member variable was added to DLabelPrivate to record the previous text. Log: fix tooltip does not show the latest text Pms: BUG-300837
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yixinshark 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 |
deepin pr auto review这段代码的修改目的是为了解决 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
5. 其他建议
总结这段代码的修改是合理的,能够解决工具提示更新不及时的问题。主要需要关注的是性能优化,尤其是在高频调用的 |
| // clear flag when text changed, avoid tooltip don't show new text | ||
| DToolTip::setShowToolTip(this, false); | ||
| } | ||
| d_func()->lastText = d->text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个移动到判断里面去吧 ,
在这paintEvent中判断文本是否发生变化,如果变化了则调用DToolTip::setShowToolTip(this, false)重置状态, 确保Tooltip能显示最新的文本内容。为此在DLabelPrivate中增加了lastText成员变量用于记录上一次的文本。
Check if the text has changed in paintEvent. If it has changed, call DToolTip::setShowToolTip(this, false) to reset the status, ensuring that the Tooltip displays the latest text content. To achieve this, a lastText member variable was added to DLabelPrivate to record the previous text.
Log: fix tooltip does not show the latest text
Pms: BUG-300837